Remove attrs limitation on style tag (#53)

* Remove attrs limitation on style tag

Closes #52
Style tags can actually have any amount of extra tags, so adding the
scoped tags is just too limiting.

* Improve attribute patterns
This commit is contained in:
Eduardo San Martin Morote
2017-03-08 00:24:40 +01:00
committed by Adriaan Zonnenberg
parent c122cb8c29
commit f75a55ef19

View File

@@ -59,30 +59,30 @@ endif
syntax include @CSS syntax/css.vim syntax include @CSS syntax/css.vim
unlet! b:current_syntax unlet! b:current_syntax
syntax region css keepend start=/<style\( \+scoped\)\?>/ end="</style>" contains=@CSS fold syntax region css keepend start=/<style\_[^>]*>/ end="</style>" contains=@CSS fold
if s:syntaxes.stylus if s:syntaxes.stylus
syntax include @stylus syntax/stylus.vim syntax include @stylus syntax/stylus.vim
unlet! b:current_syntax unlet! b:current_syntax
syntax region stylus keepend start=/<style lang=\("\|'\)[^\1]*stylus[^\1]*\1\( \+scoped\)\?>/ end="</style>" contains=@stylus fold syntax region stylus keepend start=/<style \_[^>]*lang=\("\|'\)[^\1]*stylus[^\1]*\1\_[^>]*>/ end="</style>" contains=@stylus fold
endif endif
if s:syntaxes.sass if s:syntaxes.sass
syntax include @sass syntax/sass.vim syntax include @sass syntax/sass.vim
unlet! b:current_syntax unlet! b:current_syntax
syntax region sass keepend start=/<style\( \+scoped\)\? lang=\("\|'\)[^\1]*sass[^\1]*\1\( \+scoped\)\?>/ end="</style>" contains=@sass fold syntax region sass keepend start=/<style \_[^>]*lang=\("\|'\)[^\1]*sass[^\1]*\1\_[^>]*>/ end="</style>" contains=@sass fold
endif endif
if s:syntaxes.scss if s:syntaxes.scss
syntax include @scss syntax/scss.vim syntax include @scss syntax/scss.vim
unlet! b:current_syntax unlet! b:current_syntax
syntax region scss keepend start=/<style\( \+scoped\)\? lang=\("\|'\)[^\1]*scss[^\1]*\1\( \+scoped\)\?>/ end="</style>" contains=@scss fold syntax region scss keepend start=/<style \_[^>]*lang=\("\|'\)[^\1]*scss[^\1]*\1\_[^>]*>/ end="</style>" contains=@scss fold
endif endif
if s:syntaxes.less if s:syntaxes.less
syntax include @less syntax/less.vim syntax include @less syntax/less.vim
unlet! b:current_syntax unlet! b:current_syntax
syntax region less keepend matchgroup=PreProc start=/<style\%( \+scoped\)\? lang=\("\|'\)[^\1]*less[^\1]*\1\%( \+scoped\)\?>/ end="</style>" contains=@less fold syntax region less keepend matchgroup=PreProc start=/<style \_[^>]*lang=\("\|'\)[^\1]*less[^\1]*\1\_[^>]*>/ end="</style>" contains=@less fold
endif endif
let b:current_syntax = "vue" let b:current_syntax = "vue"