support for css class names, identifiers within javascript strings
This commit is contained in:
parent
138d0bf57f
commit
6a16760fdd
|
@ -54,8 +54,10 @@ syntax keyword jsFrom contained from skipwhite skipempty nextgroup
|
||||||
syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup,jsFlowTypeKeyword
|
syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup,jsFlowTypeKeyword
|
||||||
|
|
||||||
" Strings, Templates, Numbers
|
" Strings, Templates, Numbers
|
||||||
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell,htmlTag,htmlEndTag,cssClassRegion,cssIdRegion,htmlArgRegion extend
|
syntax match jsCssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contained
|
||||||
syntax region jsString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell,htmlTag,htmlEndTag,cssClassRegion,cssIdRegion,htmlArgRegion extend
|
syntax match jsCssIdentifier "#-\=[A-Za-z_][A-Za-z0-9_-]*" contained
|
||||||
|
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell,htmlTag,htmlEndTag,cssClassRegion,cssIdRegion,htmlArgRegion,jsCssClassName,jsCssIdentifier extend
|
||||||
|
syntax region jsString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell,htmlTag,htmlEndTag,cssClassRegion,cssIdRegion,htmlArgRegion,jsCssClassName,jsCssIdentifier extend
|
||||||
syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend
|
syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend
|
||||||
syntax match jsTaggedTemplate /\k\+\%(`\)\@=/ nextgroup=jsTemplateString
|
syntax match jsTaggedTemplate /\k\+\%(`\)\@=/ nextgroup=jsTemplateString
|
||||||
syntax match jsNumber /\<\d\+\%([eE][+-]\=\d\+\)\=\>\|\<0[bB][01]\+\>\|\<0[oO]\o\+\>\|\<0[xX]\x\+\>/
|
syntax match jsNumber /\<\d\+\%([eE][+-]\=\d\+\)\=\>\|\<0[bB][01]\+\>\|\<0[oO]\o\+\>\|\<0[xX]\x\+\>/
|
||||||
|
@ -381,6 +383,9 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
|
||||||
HiLink jsCssStyles Label
|
HiLink jsCssStyles Label
|
||||||
|
|
||||||
|
HiLink jsCssClassName cssClassName
|
||||||
|
HiLink jsCssIdentifier cssIdentifier
|
||||||
|
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue