Multiple line commenting highlight fails when contains a single line comment.
fix #426
This commit is contained in:
parent
578aeb1241
commit
314b95eb78
2 changed files with 27 additions and 0 deletions
|
|
@ -161,6 +161,11 @@ var JavaScriptHighlightRules = function() {
|
|||
// makes sure we don't mix up regexps with the divison operator
|
||||
"regex_allowed": [
|
||||
{
|
||||
token : "comment", // multi line comment
|
||||
merge : true,
|
||||
regex : "\\/\\*",
|
||||
next : "comment_regex_allowed"
|
||||
}, {
|
||||
token : "comment",
|
||||
regex : "\\/\\/.*$"
|
||||
}, {
|
||||
|
|
@ -180,10 +185,23 @@ var JavaScriptHighlightRules = function() {
|
|||
next: "start"
|
||||
}
|
||||
],
|
||||
"comment_regex_allowed" : [
|
||||
{
|
||||
token : "comment", // closing comment
|
||||
regex : ".*?\\*\\/",
|
||||
merge : true,
|
||||
next : "regex_allowed"
|
||||
}, {
|
||||
token : "comment", // comment spanning whole line
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
}
|
||||
],
|
||||
"comment" : [
|
||||
{
|
||||
token : "comment", // closing comment
|
||||
regex : ".*?\\*\\/",
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, {
|
||||
token : "comment", // comment spanning whole line
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue