WordPress.org

Ready to get started?Download WordPress

Forums

comments_popup_link tag does not validate as XML with ampersands in title (3 posts)

  1. mat8iou
    Member
    Posted 8 years ago #

    In previous versions, the comments_popup_link produced code that looked something like this:
    <a href="pageurl/#comments" class="commentslink">Comments</a>

    However, in 2.0, the same page template will produce this instead.

    <a href="pageurl/#respond" class="commentslink" title="Comment on Post title">Comments</a>

    Note the addition of the title attribute.
    All works fine most of the time. However, when the post title contains an ampersand character, then the source shows up as something like title="Comment on Post title with & in it"> rather than escaping the ampersand as &amp;.
    Where this occurs, the page will no longer validate correctly as XHTML.

  2. SoundTrip
    Member
    Posted 8 years ago #

    It seems to work fine as long as you escape the ampersand in the Title yourself. If you don't them the comments do come out with an error and won't validate.

    Trip

  3. mat8iou
    Member
    Posted 8 years ago #

    This is pretty awkward if it is the only way to solve the problem.

    I'l probably end up writing my own function to try & fix this. It must be fairly simple to update how it works, as the title etc allready escape the ampersands correctly.

Topic Closed

This topic has been closed to new replies.

About this Topic