align xml mode with html mode

This commit is contained in:
Fabian Jakobs 2011-12-01 12:48:28 +01:00
commit 9a612cd2e5

View file

@ -59,8 +59,9 @@ var XmlHighlightRules = function() {
regex : "<\\!--",
next : "comment"
}, {
token : "text", // opening tag
token : "meta.tag", // opening tag
regex : "<\\/?",
merge : true,
next : "tag"
}, {
token : "text",
@ -71,12 +72,33 @@ var XmlHighlightRules = function() {
}],
tag : [{
token : "text",
token : "meta.tag",
merge : true,
regex : "\\s+"
}, {
token : "meta.tag",
regex : "[-_a-zA-Z0-9:]+",
merge : true,
next : "attribute-list"
}, {
token: "empty",
regex: "",
next : name + "attribute-list"
}],
"attribute-list": [{
token : "meta.tag",
regex : ">",
next : "start"
}, {
token : "keyword",
token : "meta.tag",
regex : "="
}, {
token : "entity.other.attribute-name",
regex : "[-_a-zA-Z0-9:]+"
}, {
token : "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token : "text",
regex : "\\s+"
@ -101,7 +123,7 @@ var XmlHighlightRules = function() {
qstring: [{
token : "string",
regex : ".*?'",
next : "tag"
next : "attribute-list"
}, {
token : "string",
merge : true,
@ -111,7 +133,7 @@ var XmlHighlightRules = function() {
qqstring: [{
token : "string",
regex : ".*?\"",
next : "tag"
next : "attribute-list"
}, {
token : "string",
merge : true,