alexgorbatchev/SyntaxHighlighter — Issue #55: [Javascript Brush] Specifying strings with single quotes in functions.
Author: joesavage
Created: 2011-11-04 07:41:44+00:00
State: open

Hi,

I was recently writing a tutorial on my website, only to find when publishing it that the syntax highlighting had really screwed up (for some reason unknown to me).
As can be demonstrated, here: http://www.dev-hq.net/7-Javascript/54-If-and-Else-statements
Using strings that are created using single quotes (apostrophes) inside a function, seems to really mess up the JScript SyntaxHighlighting. Like so:

var name = prompt('What is your name?');
if(name=='Joe') //If the user's name is 'Joe'
{
alert('Wow, cool – my name is Joe too!');
}
else if(name=='Fred') //If the user's name is 'Fred'
{
alert('Fred is a pretty generic name...');
}
else if(name=='John') //If the user's name is 'John'
{
alert('Alright, John?');
}
else if(name=='George') //If the user's name is 'George'
{
alert('George is a pretty decent name.');
}
else
{
alert('I have no opinion on your name.');
}