Forums

HTML Comments Tag Parsed Deleted (8 posts)

  1. carthik
    Member
    Posted 7 years ago #

    That is totally fudged, so I can;t follow what you're trying to convey, but WP does the mapping so your content is XHTML compliant.
    Look in wp-includes for functions-formatting.php there should be code in there that does that, which you can edit.

  2. TechGnome
    Moderator
    Posted 7 years ago #

    Or it could be a plugin... If I remember right, texturizer does some funky stuff. But I could be wrong -- it's been known to happen.
    Tg

  3. Kafkaesqui
    Moderator
    Posted 7 years ago #

    I believe what he means is that when you insert an HTML comment in a post, WP is filtering the last portion (-->), interpreting '--' as the character entity for the en dash. I get the same, and do not use any text formatting plugins.
    Anyway, one method for avoiding this with WP as it is, is to keep the comment all on a single line.

  4. Anonymous
    Unregistered
    Posted 7 years ago #

    First off... I apologize for the long post. I wanted to include all the information necessary to understand and reproduce this issue.
    This bug prevents embedding machine-readable licenses from creative commons in WordPress posts. The RDF output for the machine-readable license is embedded in a multiple line html comment that gets destroyed during posting. I have tried turning off the option of have WordPress correct invalid xhtml, and I have tried listing the entire code on one line. I believe the problem in this case is that the code is "too long" and WP inserts its own line breaks, and consequently eats the comment tags.
    Correct code from Creative Commons (minus line breaks) is as follows:
    <!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""> <dc:type rdf:resource="http://purl.org/dc/dcmitype/MovingImage" /> <license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.0/"> <permits rdf:resource="http://web.resource.org/cc/Reproduction" /> <permits rdf:resource="http://web.resource.org/cc/Distribution" /> <requires rdf:resource="http://web.resource.org/cc/Notice" /> <requires rdf:resource="http://web.resource.org/cc/Attribution" /> <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" /> <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> <requires rdf:resource="http://web.resource.org/cc/ShareAlike" /></License></rdf:RDF> -->
    WP mangles that code into (note the addition of the p and br tags, as well as the mangling of the open comment tag and the disappearance of the close comment tag):
    -- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""> <dc:type rdf:resource="http://purl.org/dc/dcmitype/MovingImage" />

    <license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.0/">

    <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
    <permits rdf:resource="http://web.resource.org/cc/Distribution" /> <requires rdf:resource="http://web.resource.org/cc/Notice" /> <requires rdf:resource="http://web.resource.org/cc/Attribution" />

    <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" />
    <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> <requires rdf:resource="http://web.resource.org/cc/ShareAlike" /></License></rdf:RDF> –>

  5. Anonymous
    Unregistered
    Posted 7 years ago #

    Umm... the correct code mysteriously disappeared in the last post. I'll try again:
    Correct code from Creative Commons (minus line breaks) is as follows:
    <!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""> <dc:type rdf:resource="http://purl.org/dc/dcmitype/MovingImage" /> <license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.0/"> <permits rdf:resource="http://web.resource.org/cc/Reproduction" /> <permits rdf:resource="http://web.resource.org/cc/Distribution" /> <requires rdf:resource="http://web.resource.org/cc/Notice" /> <requires rdf:resource="http://web.resource.org/cc/Attribution" /> <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" /> <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> <requires rdf:resource="http://web.resource.org/cc/ShareAlike" /></License></rdf:RDF> -->

  6. Anonymous
    Unregistered
    Posted 7 years ago #

    Unbelieveable. Example code to trigger the error can be obtained at the creative commons website, the offending portion is the RDF section.
    http://creativecommons.org/license/

  7. richardc020
    Member
    Posted 7 years ago #

    Texturizer does all of the above's reported behaviors. Very annoying and, moreover, unfunctional.

    It'd be nice if whoever codes Texturizer posted here, but I suppose this problem is uncared for because of its difficulty and lack of priority.

  8. MikeLococo
    Member
    Posted 7 years ago #

    I submitted a bug report about this some time ago which was closed "won't fix". The workaround is apparently not to use HTML comments in posts.
    http://mosquito.wordpress.org/view.php?id=712

    The same problem has already been fixed for <pre> tags, so I'm not clear on why it would be so much more difficult for comments.
    http://mosquito.wordpress.org/view.php?id=488

    Perhaps I'll take a closer look at the <pre> patch and see if it could be adapted to work for comments as well. It was a fairly short hack. I feel like autop is overly agressive about inserting line breaks though.
    http://wiki.wordpress.org/?pagename=autop-bugs

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.