• This plugin is this close to doing exactly what I need, but I’m having a strange problem. I have fenced code blocks in my post, like:


    ~~~~
    !#cpp
    int main()
    {
    /*...*/
    }
    ~~~~

    This shows up in code font, but is not syntax highlighted. If, somewhere else on the page, I have another code block of this form:


    [code lang="cpp"]
    int foo() { return 0; }
    [/code]

    … then that shows up highlighted, and so does the other block! How crazy is that?

    I’d be fine with this workaround if it weren’t for one thing. When I use the [code]...[/code] form, WP-Markdown makes a hash of that code’s formatting. So my choices are to have no code highlighted, or else have one block that is mis-formatted. Gah. Any guidance is appreciated.

    I’m using WP-Markdown 1.2, SyntaxHighlighter Evolved 3.1.7, and wp-markdown-syntaxhighlighter 0.4.

    https://www.ads-software.com/extend/plugins/wp-markdown-syntaxhighlighter/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter eric_niebler

    (@eric_niebler)

    For anybody else who has this problem, I found a better workaround. If I put some a code block in an HTML comment, that seems to be enough to get SyntaxHighlighter to wake up and do its job.


    <--
    [code lang="cpp"]xxx[/code]
    -->

    As long as that is on the page somewhere, the C++ syntax highligher script gets loaded, and the other code on the page gets highlighted.

    Needless to say, it would still be nice to have this bug fixed.

    Plugin Author mattshelton

    (@mattshelton)

    Hi Eric,

    You have the # and ! backwards. ??

    ~~~~
    #!cpp
    int main()
    {
    /*…*/
    }
    ~~~~

    Thread Starter eric_niebler

    (@eric_niebler)

    Heh. That’s just a typo in my bug report. (Sorry.) On my blog, it’s a proper shebang, and the issue persists.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SyntaxHighlighter scripts not loading unless….’ is closed to new replies.