fix for #618: Editor gets blocked when typing <style type="

happened when rule started with same prefix as embedded language name
This commit is contained in:
nightwing 2012-01-25 00:15:46 +04:00
commit d46983aa5f
3 changed files with 11 additions and 11 deletions

View file

@ -70,7 +70,7 @@ var ColdfusionHighlightRules = function() {
}, { }, {
token : "meta.tag", token : "meta.tag",
regex : "<(?=\s*style)", regex : "<(?=\s*style)",
next : "css" next : "style"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -109,7 +109,7 @@ var ColdfusionHighlightRules = function() {
}; };
xml_util.tag(this.$rules, "tag", "start"); xml_util.tag(this.$rules, "tag", "start");
xml_util.tag(this.$rules, "css", "css-start"); xml_util.tag(this.$rules, "style", "css-start");
xml_util.tag(this.$rules, "script", "js-start"); xml_util.tag(this.$rules, "script", "js-start");
this.embedRules(JavaScriptHighlightRules, "js-", [{ this.embedRules(JavaScriptHighlightRules, "js-", [{

View file

@ -69,7 +69,7 @@ var HtmlHighlightRules = function() {
}, { }, {
token : "meta.tag", token : "meta.tag",
regex : "<(?=\s*style\\b)", regex : "<(?=\s*style\\b)",
next : "css" next : "style"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -108,7 +108,7 @@ var HtmlHighlightRules = function() {
}; };
xmlUtil.tag(this.$rules, "tag", "start"); xmlUtil.tag(this.$rules, "tag", "start");
xmlUtil.tag(this.$rules, "css", "css-start"); xmlUtil.tag(this.$rules, "style", "css-start");
xmlUtil.tag(this.$rules, "script", "js-start"); xmlUtil.tag(this.$rules, "script", "js-start");
this.embedRules(JavaScriptHighlightRules, "js-", [{ this.embedRules(JavaScriptHighlightRules, "js-", [{

View file

@ -56,7 +56,7 @@ function string(state) {
token : "string", // multi line string start token : "string", // multi line string start
merge : true, merge : true,
regex : '["].*', regex : '["].*',
next : state + "-qqstring" next : state + "_qqstring"
}, { }, {
token : "string", token : "string",
regex : "'.*?'" regex : "'.*?'"
@ -64,7 +64,7 @@ function string(state) {
token : "string", // multi line string start token : "string", // multi line string start
merge : true, merge : true,
regex : "['].*", regex : "['].*",
next : state + "-qstring" next : state + "_qstring"
}]; }];
} }
@ -113,17 +113,17 @@ exports.tag = function(states, name, nextState) {
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:!]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "embed-attribute-list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",
regex: "", regex: "",
next : name + "embed-attribute-list" next : name + "_embed_attribute_list"
}]; }];
states[name + "-qstring"] = multiLineString("'", name + "embed-attribute-list"); states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
states[name + "-qqstring"] = multiLineString("\"", name + "embed-attribute-list"); states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
states[name + "embed-attribute-list"] = [{ states[name + "_embed_attribute_list"] = [{
token : "meta.tag", token : "meta.tag",
merge : true, merge : true,
regex : "\/?>", regex : "\/?>",