Closed Bug 702994 Opened 14 years ago Closed 14 years ago

File Viewer syntax highlighting broken with single quote mark

Categories

(addons.mozilla.org Graveyard :: Admin/Editor Tools, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Q2 2012

People

(Reporter: eviljeff, Unassigned)

References

()

Details

(Whiteboard: [ReviewTeam])

The file viewer seems to have occasional trouble handling some single quotes. In the URL link you should be able to see the closing ' of the string ignored so the following lines in the files shown as part of a string rather than executable code. this is the line: [var toolbar_container = document.createElement('hbox');]
The syntax highlighter should give up on any strings at the end of a line unless the line ends in a backslash. I see this all the time and wind up using an external diff viewer as a result.
The following seems to do the trick: $.extend(SyntaxHighlighter.regexLib, { multiLineDoubleQuotedString: /"([^\\"\n]|\\[^])*"/g, multiLineSingleQuotedString: /'([^\\'\n]|\\[^])*'/g });
Whiteboard: [ReviewTeam]
Target Milestone: --- → Q2 2012
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.