WordPress.org

Ready to get started?Download WordPress

Forums

SyntaxHighlighter Evolved
HTML5/XHTML5 Validation error (12 posts)

  1. Sandro Bilbeisi
    Member
    Posted 3 years ago #

    SyntaxHighlighter Evolved emits a meta tag in the head of the document which is not supported by HTML5/XHTML5 (experimental) validators.

    Error: Bad value syntaxhighlighter-version for attribute name on element meta: Keyword syntaxhighlighter-version is not registered.
    <meta id="syntaxhighlighteranchor" name="syntaxhighlighter-version" content="3.1.1" />

    http://wordpress.org/extend/plugins/syntaxhighlighter/

  2. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 3 years ago #

    I was under the impression that the <meta> tag name value could be anything you wanted it to be. Not sure why it's throwing an error.

    That tag is used by a bit of Javascript to dynamically add some CSS stylesheets directly after it by the way.

  3. jwind
    Member
    Posted 2 years ago #

    it used to validate. Now it doesn't. Any fix? It's the only error on my page. I'll prefer to not spend a whole lot of time trouble shooting this.

  4. GPixels
    Member
    Posted 2 years ago #

    Actually, I hope to find out the answer to this too...I need my theme to go green! Overall, this plugin is great but just that little quirk that needs a solution.

  5. GPixels
    Member
    Posted 2 years ago #

    Not sure if this meta tag will be removed from the plugin in a next version from Viper007Bond, but for a nice valid site, I tried one thing, although it's not really the best way, is to comment out line 570 in the syntaxhighlighter.php file...the part that begins with:
    echo '<meta id="syntaxhighlighteranchor" ..... just put a couple forward slashes in front of echo. Make sure you keep a copy of the original file before doing this incase you have to go back. Also, the messy part is updating the plugin, it will overwrite what was commented out. So far the site works and the validation is all green. Still, it's an awesome plugin!

  6. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 2 years ago #

    I'm not outputting that meta tag for fun. ;)

    The plugin uses it as an anchor. Javascript finds it and then dynamically adds the stylesheets after it. This is better than directly before </head> because this way other stylesheets can override values.

  7. GPixels
    Member
    Posted 2 years ago #

    ah... so Alex is watching the thread here :)

    Anyway, I still commented it out. As for css, I simply added some custom styling to my theme's style.css instead. Of course, that is just me, and not sure it's what others would do.

    The meta tag is just an irritating itch for me personally, but regardless, it's still a great plugin.

  8. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 2 years ago #

    ah... so Alex is watching the thread here :)

    Yeah, I'm trying to be better about watching support threads about my plugins. :)

    I just had an "aha!" moment -- I bet I could hook onto the <title> element. This is way early in the <head> and should accomplish the same thing. :)

  9. GPixels
    Member
    Posted 2 years ago #

    If whatever you do is an alternative and it works, I will have to buy you a grande mocha! Of course, that means coming to Vancouver...lol

  10. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 2 years ago #

    I'm in Portland actually. :)

  11. GPixels
    Member
    Posted 2 years ago #

    Vancouver, BC, Canada for moi....almost neighbors!
    Well..back to design work for me, have to get this new theme finished :)

  12. newDelacroix
    Member
    Posted 2 years ago #

    I don’t know if this might do the trick or if this problem is still relevant. But what if instead of outputting it in output_header_placeholder() function, we comment it out and write anonymous jQuery function which appends it to <head /> section?

    Something like:
    $("head").before('<meta id="syntaxhighlighteranchor" name="syntaxhighlighter-version" />');

    And then simply add it through wp_enqueue_script() if functions.php

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic