support XML comments
This commit is contained in:
parent
07dc92addb
commit
a1dd52ebc8
1 changed files with 19 additions and 1 deletions
20
XML.js
20
XML.js
|
|
@ -17,6 +17,11 @@ XML.RULES = {
|
||||||
token: "xml_pe",
|
token: "xml_pe",
|
||||||
regex: "<\\?.*?\\?>"
|
regex: "<\\?.*?\\?>"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
token: "comment",
|
||||||
|
regex: "<\\!--",
|
||||||
|
next: "comment"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
token: "text", // opening tag
|
token: "text", // opening tag
|
||||||
regex: "<",
|
regex: "<",
|
||||||
|
|
@ -65,13 +70,26 @@ XML.RULES = {
|
||||||
next: "start"
|
next: "start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: "string",
|
token: "text",
|
||||||
regex: "\\s+"
|
regex: "\\s+"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: "text",
|
token: "text",
|
||||||
regex: ".+"
|
regex: ".+"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
comment:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
token: "comment",
|
||||||
|
regex: ".*?-->",
|
||||||
|
next: "start"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
token: "comment",
|
||||||
|
regex: ".+"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue