diff --git a/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js b/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js index 4a6beedd..a1c1ca79 100644 --- a/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js +++ b/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js @@ -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; diff --git a/lib/ace/mode/xquery_highlight_rules.js b/lib/ace/mode/xquery_highlight_rules.js index 7d945015..856fc32f 100644 --- a/lib/ace/mode/xquery_highlight_rules.js +++ b/lib/ace/mode/xquery_highlight_rules.js @@ -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: "(?:[^\\]]|\\](?!\\]>))+" }],