mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-09-03 23:57:13 -04:00
Support initial batch of languages
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
//go:build stxXml || stxAll
|
||||
|
||||
package syntax
|
||||
|
||||
func init() {
|
||||
syntaxMap["xml"] = &lazySyntax{init: func() []byte {
|
||||
return []byte(`filetype: xml
|
||||
|
||||
detect:
|
||||
filename: "\\.(xml|sgml?|rng|plist)$"
|
||||
header: "(<rss|<!DOCTYPE|<xsd|<\\?xml)"
|
||||
|
||||
rules:
|
||||
- type: "(<(/)?[a-zA-Z:]+>)"
|
||||
- type: "(<(/)?[a-zA-Z:]+[[:space:]]+)"
|
||||
- constant.specialChar: '[a-zA-Z0-9]+="(.*)+"'
|
||||
- statement: '([a-zA-Z0-9]+)='
|
||||
- type: "(([[:space:]])?/?>([[:space:]]+)?$)"
|
||||
- comment:
|
||||
start: "<!DOCTYPE"
|
||||
end: "[/]?>"
|
||||
rules: []
|
||||
- comment:
|
||||
start: "<!--"
|
||||
end: "-->"
|
||||
rules: []
|
||||
- special: "&[^;]*;"`)
|
||||
}}
|
||||
}
|
||||
Reference in New Issue
Block a user