Lose HTML Gate in the consol



  • Code

    textWithLinks = textWithLinks.replaceAll(name, "<a href=\""+name+".html\">"+name+"</a>");
    System.out.println(textWithLinks);
    

    How to work:

    <a href="файл.html">файл</a>
    

    As a matter of fact:

    файл.html файл
    

    In short, the conclusion was eaten by the shadows.

    Please help me. Thank you very much.



  • I wouldn't say that the problem is in the html strategies, and the console's doing it well, I don't know, but the reason is probably < and >which are specials and most likely display problems, I will not say the reason, but I would still like to know it, so try to replace these symbols in this method with equivalents.

    <&lt;

    >&gt;

    That's the end of your life:

    .replaceAll(name, "&lt;a href=\""+name+".html\"&gt;"+name+"&lt;/a&gt;");
    


    UPD: In fact, the most likely reason is to use the methods of extracting the text from the html code, because I have not met such problems in practice.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2