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;
|
}return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.CDataSection = function(node)
|
||||||
|
{
|
||||||
|
var value = this.getNodeValue(node);
|
||||||
|
this.addTokens(value, "support.type");
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
this.Comment = function(node)
|
this.Comment = function(node)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ var XQueryHighlightRules = function() {
|
||||||
// regexps are ordered -> the first match is used
|
// regexps are ordered -> the first match is used
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
start: [{
|
start: [{
|
||||||
token: "text",
|
token: "support.type",
|
||||||
regex: "<\\!\\[CDATA\\[",
|
regex: "<\\!\\[CDATA\\[",
|
||||||
next: "cdata"
|
next: "cdata"
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -126,14 +126,14 @@ var XQueryHighlightRules = function() {
|
||||||
}],
|
}],
|
||||||
|
|
||||||
cdata: [{
|
cdata: [{
|
||||||
token: "comment",
|
token: "support.type",
|
||||||
regex: "\\]\\]>",
|
regex: "\\]\\]>",
|
||||||
next: "start"
|
next: "start"
|
||||||
}, {
|
}, {
|
||||||
token: "comment",
|
token: "support.type",
|
||||||
regex: "\\s+"
|
regex: "\\s+"
|
||||||
}, {
|
}, {
|
||||||
token: "comment",
|
token: "support.type",
|
||||||
regex: "(?:[^\\]]|\\](?!\\]>))+"
|
regex: "(?:[^\\]]|\\](?!\\]>))+"
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue