Added separate syntax highlighting inside XML tags
This commit is contained in:
@@ -61,12 +61,15 @@ syn match logFilePath '\/\w[^\n|,; ()'"]\+'
|
|||||||
|
|
||||||
" XML Tags
|
" XML Tags
|
||||||
"---------------------------------------------------------------------------
|
"---------------------------------------------------------------------------
|
||||||
" TODO: Highlight attributes and symbols inside tags differently
|
syn match logXmlHeader /<?\w\+\(\s\+\w\+\(="[^"]*"\|='[^']*'\)\?\)*?>/ contains=logString,logXmlAttribute,logXmlNamespace
|
||||||
" TODO: Consider matching multiline tags
|
syn match logXmlDoctype /<!DOCTYPE[^>]*>/ contains=logString,logXmlAttribute,logXmlNamespace
|
||||||
syn match logXmlHeader #<?\w\+\(\s\+\w\+\(="[^"]*"\|='[^']*'\)\?\)*?>#
|
|
||||||
syn match logXmlTag #<\/\?\(\w\+:\)\?\w\+\(\s\+\w\+\(="[^"]*"\|="[^"]*"\)\?\)*\s*\/\?>#
|
syn match logXmlTag /<\/\?\(\w\+:\)\?\w\+\(\(\n\|\s\)\+\(\w\+:\)\?\w\+\(="[^"]*"\|="[^"]*"\)\?\)*\s*\/\?>/ contains=logString,logXmlAttribute,logXmlNamespace
|
||||||
syn match logXmlComment '<!--.*-->'
|
syn match logXmlAttribute contained "\w\+=" contains=logOperator
|
||||||
syn match logXmlCData '<!\[CDATA\[.*\]\]>'
|
syn match logXmlAttribute contained "\(\n\|\s\)\(\w\+:\)\?\w\+" contains=logXmlNamespace,logOperator
|
||||||
|
syn match logXmlNamespace contained "\w\+:" contains=logOperator
|
||||||
|
syn region logXmlComment start=/<!--/ end=/-->/
|
||||||
|
syn match logXmlCData /<!\[CDATA\[.*\]\]>/
|
||||||
|
|
||||||
|
|
||||||
" Levels
|
" Levels
|
||||||
@@ -102,7 +105,10 @@ hi def link logMacAddress Label
|
|||||||
hi def link logFilePath Conditional
|
hi def link logFilePath Conditional
|
||||||
|
|
||||||
hi def link logXmlHeader Function
|
hi def link logXmlHeader Function
|
||||||
hi def link logXmlTag Special
|
hi def link logXmlDoctype Function
|
||||||
|
hi def link logXmlTag Identifier
|
||||||
|
hi def link logXmlAttribute Type
|
||||||
|
hi def link logXmlNamespace Include
|
||||||
hi def link logXmlComment Comment
|
hi def link logXmlComment Comment
|
||||||
hi def link logXmlCData String
|
hi def link logXmlCData String
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user