Improve syntax highlighting of cdata sections.
This commit is contained in:
parent
7dc7aa4295
commit
e0c36db7a5
2 changed files with 12 additions and 5 deletions
|
|
@ -267,7 +267,14 @@ var SyntaxHighlighter = exports.SyntaxHighlighter = function(tree)
|
|||
}
|
||||
}return true;
|
||||
}
|
||||
|
||||
|
||||
this.CDataSection = function(node)
|
||||
{
|
||||
var value = this.getNodeValue(node);
|
||||
this.addTokens(value, "support.type");
|
||||
return true;
|
||||
};
|
||||
|
||||
this.Comment = function(node)
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ var XQueryHighlightRules = function() {
|
|||
// regexps are ordered -> the first match is used
|
||||
this.$rules = {
|
||||
start: [{
|
||||
token: "text",
|
||||
token: "support.type",
|
||||
regex: "<\\!\\[CDATA\\[",
|
||||
next: "cdata"
|
||||
}, {
|
||||
|
|
@ -126,14 +126,14 @@ var XQueryHighlightRules = function() {
|
|||
}],
|
||||
|
||||
cdata: [{
|
||||
token: "comment",
|
||||
token: "support.type",
|
||||
regex: "\\]\\]>",
|
||||
next: "start"
|
||||
}, {
|
||||
token: "comment",
|
||||
token: "support.type",
|
||||
regex: "\\s+"
|
||||
}, {
|
||||
token: "comment",
|
||||
token: "support.type",
|
||||
regex: "(?:[^\\]]|\\](?!\\]>))+"
|
||||
}],
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue