Code highlight problem
-
[code lang='javascript']
var shouldNotBeHighlighted = 'hello,world';
// problem is here, you don't ignore the single quote inside this comment
console.log('hello,world' + shouldNotBeHighlighted + 'helloworld!');
// so that the syntax highlight is messed up!!
[/code]
I was on http://rabbitaaron.wordpress.com/ when I found this bug.
Just add a new post and copy paste then you’ll see.The blog I need help with is: (visible only to logged in users)
-
-
As what you can see, the ‘hello,world’ in the single quotes in line 3, the string, are not highlighted, instead, the variable is highlighted. It is because of the 2nd line, in the world ‘don’t’, where the single quote should be ignored because it is in a quote comment, but didn’t
-
the correct highlight should be http://rabbitaaron.files.wordpress.com/2014/04/correct.png?w=712
-
Thanks for the additional information. We received another report about syntax highlighting and I’ve passed both reports along to our developers so they can have a look.
https://en.forums.wordpress.com/topic/syntax-highlighting-for-c-got-suddently-broken
-
Hi again – as it turns out, the highlighting issue you pointed out is totally unrelated to the issue that other folks were having.
Our developers had a look at the highlighting problem and it looks like something that stems back to this issue in the original plugin we’re using:
https://github.com/alexgorbatchev/syntaxhighlighter/issues/215
It looks like someone proposed a fix a few months back, but unfortunately it’s not a change we’ll be able to put into effect right away as it may break other things in our implementation of the plugin. I’m sorry I don’t have better news.
- The topic ‘Code highlight problem’ is closed to new replies.
