Support » Fixing WordPress » WordPress encoding html comment tags

  • I’ve got some code which adds content to the post and I want to include some HTML comments in there.

    But I have a problem.

    The opening tag <!-- goes through fine but the closing tag --> gets turned into–> (thats & # 8211 > ) which of course breaks everything.

    I assume its actually some sort of bug in WordPress because <-- doesn’t get converted so its not the presence of -- that makes it go wrong.

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi


    Forum Moderator

    Sounds more like your comment syntax is incorrect. It should be <-- and -->. The trailing and leading spaces are important.

    I’ve tried just about every spacing option I can think of and it still does it. I guess I’ll have to dig into the WordPress code and try to find out where it handles HTML comment tags and determine what it thinks a closing HTML comment looks like.

    Edited to add : Or it could have been down to a rogue > which got into the text.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress encoding html comment tags’ is closed to new replies.