diff --git a/lib/ace/mode/xquery_highlight_rules.js b/lib/ace/mode/xquery_highlight_rules.js index 4d082425..e407d1bd 100644 --- a/lib/ace/mode/xquery_highlight_rules.js +++ b/lib/ace/mode/xquery_highlight_rules.js @@ -70,7 +70,7 @@ var XQueryHighlightRules = function() { }, { token: ["text", "meta.tag"], // opening tag - regex: "(<)(" + qname + ")", + regex: "(<\\/?)(" + qname + ")", next: "tag" }, { token: "constant", // number @@ -90,7 +90,13 @@ var XQueryHighlightRules = function() { token: "text", regex: "\\s+" }, { - token: function(match) { if(keywords.indexOf(match) !== -1) { return "keyword" } else { return "support.function" } }, + token: function(match) { + if(keywords.indexOf(match.toLowerCase()) !== -1) { + return "keyword" + } else { + return "support.function" + } + }, regex: eqname }, { token: "keyword.operator", @@ -201,7 +207,7 @@ var XQueryHighlightRules = function() { "apos-string": [{ token: "string", - regex: ".*?'", + regex: ".*'", next: "start" }, { token: "string", @@ -210,7 +216,7 @@ var XQueryHighlightRules = function() { "quot-string": [{ token: "string", - regex: '.*?"', + regex: '.*"', next: "start" }, { token: "string", @@ -219,7 +225,7 @@ var XQueryHighlightRules = function() { "apos-attr": [{ token: "string", - regex: ".*?'", + regex: ".*'", next: "tag" }, { token: "string", @@ -228,7 +234,7 @@ var XQueryHighlightRules = function() { "quot-attr": [{ token: "string", - regex: '.*?"', + regex: '.*"', next: "tag" }, { token: "string",