WordPress.org

Ready to get started?Download WordPress

Forums

Unable to use html commenting in post content! (4 posts)

  1. vavroom
    Member
    Posted 6 years ago #

    Hello,

    I'm encountering an interesting problem. I've searched on both this forum and Google but can't seem to find a solution to this.

    I have the wysiwyg editor turned off as a matter of course, as I write my own HTML. In some cases, I need to put text within HTML comments, using the following syntax:
    <!-- some text or comment -->

    However, since I've upgraded to 2.5.1 instead of hiding the text, as it should, anything after the start of the comment tag is hidden (even the stuff that appears outside of the comment). The only thing showing is the end of the tag!

    I tried on a fresh install of 2.5.1, thinking it might be a problem with a conflicting plugin, or remnants of past installs, but nothing serves to shake it!

    Any idea on how I can resolve this? Thanks

  2. vavroom
    Member
    Posted 6 years ago #

    *bump* ok, I know, it's bad form to bump, but 3 days without a response...

    Has no one any idea? Is this a result due to WP's parser somehow? Any idea how I *can* keep text commented out that gets put in the content window? Any assistance would be GREATLY appreciated

  3. monkphin
    Member
    Posted 6 years ago #

    Getting the same issue here.

    I suspect you may be onto something with suspecting the parser, through testing I've noticed that while it honours the opening of the tag (<!--) and doesn't render anything past the thing, it seems to not pick up on the close of the tag (-->) and seems to include it in the commented out code, along with anything after it.

    Unfortunately, due to being on a rush job to upgrade my companies site very drastically in terms of WP version I don't have time to look into it more than this.

  4. Astrodan
    Member
    Posted 6 years ago #

    I just had the same problem, and as the html source code showed the -- of the closing tag was converted into some sort of hexadecimal entity, for what reason i don't know.
    I finally solved the problem by putting the whole comment (without comment tags) into <div style="display: none;">[...]</div>, which gives nearly the same result as <!-- --> would have done..

Topic Closed

This topic has been closed to new replies.

About this Topic