Change HTML highlight rules to match chrome theme.
Conflicts: lib/ace/mode/html_highlight_rules.js
This commit is contained in:
parent
d62c796785
commit
5d0bc99d99
1 changed files with 14 additions and 11 deletions
|
|
@ -51,7 +51,7 @@ var HtmlHighlightRules = function() {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '".*?"'
|
regex : '".*?"'
|
||||||
}, {
|
}, {
|
||||||
token : "string", // multi line string start
|
token : "meta.tag", // multi line string start
|
||||||
merge : true,
|
merge : true,
|
||||||
regex : '["].*$',
|
regex : '["].*$',
|
||||||
next : state + "-qqstring"
|
next : state + "-qqstring"
|
||||||
|
|
@ -59,7 +59,7 @@ var HtmlHighlightRules = function() {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : "'.*?'"
|
regex : "'.*?'"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // multi line string start
|
token : "meta.tag", // multi line string start
|
||||||
merge : true,
|
merge : true,
|
||||||
regex : "['].*$",
|
regex : "['].*$",
|
||||||
next : state + "-qstring"
|
next : state + "-qstring"
|
||||||
|
|
@ -68,7 +68,7 @@ var HtmlHighlightRules = function() {
|
||||||
|
|
||||||
function multiLineString(quote, state) {
|
function multiLineString(quote, state) {
|
||||||
return [{
|
return [{
|
||||||
token : "string",
|
token : "meta.tag",
|
||||||
merge : true,
|
merge : true,
|
||||||
regex : ".*" + quote,
|
regex : ".*" + quote,
|
||||||
next : state
|
next : state
|
||||||
|
|
@ -97,9 +97,12 @@ var HtmlHighlightRules = function() {
|
||||||
states[name + "-qqstring"] = multiLineString("\"", name);
|
states[name + "-qqstring"] = multiLineString("\"", name);
|
||||||
|
|
||||||
states[name + "embed-attribute-list"] = [{
|
states[name + "embed-attribute-list"] = [{
|
||||||
token : "text",
|
token : "meta.tag",
|
||||||
regex : ">",
|
regex : ">",
|
||||||
next : nextState
|
next : nextState
|
||||||
|
}, {
|
||||||
|
token : "meta.tag",
|
||||||
|
regex : "="
|
||||||
}, {
|
}, {
|
||||||
token : "entity.other.attribute-name",
|
token : "entity.other.attribute-name",
|
||||||
regex : "[-_a-zA-Z0-9:]+"
|
regex : "[-_a-zA-Z0-9:]+"
|
||||||
|
|
@ -114,7 +117,7 @@ var HtmlHighlightRules = function() {
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
start : [ {
|
start : [ {
|
||||||
token : "text",
|
token : "meta.tag",
|
||||||
merge : true,
|
merge : true,
|
||||||
regex : "<\\!\\[CDATA\\[",
|
regex : "<\\!\\[CDATA\\[",
|
||||||
next : "cdata"
|
next : "cdata"
|
||||||
|
|
@ -127,15 +130,15 @@ var HtmlHighlightRules = function() {
|
||||||
regex : "<\\!--",
|
regex : "<\\!--",
|
||||||
next : "comment"
|
next : "comment"
|
||||||
}, {
|
}, {
|
||||||
token : "text",
|
token : "meta.tag",
|
||||||
regex : "<(?=\s*script)",
|
regex : "<(?=\s*script)",
|
||||||
next : "script"
|
next : "script"
|
||||||
}, {
|
}, {
|
||||||
token : "text",
|
token : "meta.tag",
|
||||||
regex : "<(?=\s*style)",
|
regex : "<(?=\s*style)",
|
||||||
next : "css"
|
next : "css"
|
||||||
}, {
|
}, {
|
||||||
token : "text", // opening tag
|
token : "meta.tag", // opening tag
|
||||||
regex : "<\\/?",
|
regex : "<\\/?",
|
||||||
next : "tag"
|
next : "tag"
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -176,17 +179,17 @@ var HtmlHighlightRules = function() {
|
||||||
tag(this.$rules, "script", "js-start");
|
tag(this.$rules, "script", "js-start");
|
||||||
|
|
||||||
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
||||||
token: "comment",
|
token: "meta.tag",
|
||||||
regex: "\\/\\/.*(?=<\\/script>)",
|
regex: "\\/\\/.*(?=<\\/script>)",
|
||||||
next: "tag"
|
next: "tag"
|
||||||
}, {
|
}, {
|
||||||
token: "text",
|
token: "meta.tag",
|
||||||
regex: "<\\/(?=script)",
|
regex: "<\\/(?=script)",
|
||||||
next: "tag"
|
next: "tag"
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
this.embedRules(CssHighlightRules, "css-", [{
|
this.embedRules(CssHighlightRules, "css-", [{
|
||||||
token: "text",
|
token: "meta.tag",
|
||||||
regex: "<\\/(?=style)",
|
regex: "<\\/(?=style)",
|
||||||
next: "tag"
|
next: "tag"
|
||||||
}]);
|
}]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue