Closed Bug 563312 Opened 14 years ago Closed 13 years ago

JavaScript highlighter doesn't handle quotes in regexes

Categories

(Skywriter Graveyard :: Syntax Highlighting, defect)

0.7.0
x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: dangoor, Assigned: pcwalton)

References

Details

Attachments

(1 file)

From steglasi on the mailing list:

While I was working on my PHP Highlighter I noticed the javascript
highlighter was going a little nutty when it came across my regex's
that included quotes in them (thinking they were beginnings of
strings) or comments in cases where there were /* or // in it.

So I made a quick change to the javascript highlighter so it would
consider the regex a string when surrounded in forward slashes. You
can find the diff at the following url:

http://www.subpacket.com/bespin/diffs/javascript_regex.diff

This should be applied to bespinclient/plugins/supported/
javascript.js.

Hope this helps make things look a little nicer for those editing js!
This is a diversion from pwalton's current work, but it's likely something that he can eyeball quickly to see if there are any issues.
Assignee: nobody → pwalton
This particular fix is a bit *too* simple and will get tripped up on division. JavaScript's regex engine may not even offer a way to do this properly.

Punting for now... the parser-based syntax highlighter will likely do better here.
Target Milestone: 0.8 → ---
Depends on: 553317
Changeset 0c93a5cb0dba makes this a little better, by limiting the damage to the line with the regex.
ACETRANSITION

The Skywriter project has merged with Ajax.org's Ace project (the full server part of which is their Cloud9 IDE project). Background on the change is here:

http://mozillalabs.com/skywriter/2011/01/18/mozilla-skywriter-has-been-merged-into-ace/

The bugs in the Skywriter product are not necessarily relevant for Ace and quite a bit of code has changed. For that reason, I'm closing all of these bugs. Problems that you have with Ace should be filed in the Ace issue tracker at GitHub:

https://github.com/ajaxorg/ace/issues
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: