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",
|
||||
regex: "<\\?.*?\\?>"
|
||||
},
|
||||
{
|
||||
token: "comment",
|
||||
regex: "<\\!--",
|
||||
next: "comment"
|
||||
},
|
||||
{
|
||||
token: "text", // opening tag
|
||||
regex: "<",
|
||||
|
|
@ -65,13 +70,26 @@ XML.RULES = {
|
|||
next: "start"
|
||||
},
|
||||
{
|
||||
token: "string",
|
||||
token: "text",
|
||||
regex: "\\s+"
|
||||
},
|
||||
{
|
||||
token: "text",
|
||||
regex: ".+"
|
||||
}
|
||||
],
|
||||
|
||||
comment:
|
||||
[
|
||||
{
|
||||
token: "comment",
|
||||
regex: ".*?-->",
|
||||
next: "start"
|
||||
},
|
||||
{
|
||||
token: "comment",
|
||||
regex: ".+"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue