mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-08 11:34:46 +08:00
Merge commit '62ef855ef42e7c0fc9c0' into mustache
This commit is contained in:
17
unittest.vim
17
unittest.vim
@@ -400,5 +400,22 @@ finish
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'category': 'mustache',
|
||||||
|
'tests': [
|
||||||
|
{
|
||||||
|
'name': "div#{{foo}}",
|
||||||
|
'query': "div#{{foo}}",
|
||||||
|
'type': "mustache",
|
||||||
|
'result': "<div id=\"{{foo}}\"></div>\n",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': "div.{{foo}}",
|
||||||
|
'query': "div.{{foo}}",
|
||||||
|
'type': "mustache",
|
||||||
|
'result': "<div class=\"{{foo}}\"></div>\n",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
]
|
]
|
||||||
" vim:set et:
|
" vim:set et:
|
||||||
|
|||||||
@@ -846,6 +846,9 @@ let s:zen_settings = {
|
|||||||
\ },
|
\ },
|
||||||
\ 'xhtml': {
|
\ 'xhtml': {
|
||||||
\ 'extends': 'html'
|
\ 'extends': 'html'
|
||||||
|
\ },
|
||||||
|
\ 'mustache': {
|
||||||
|
\ 'extends': 'html'
|
||||||
\ }
|
\ }
|
||||||
\}
|
\}
|
||||||
|
|
||||||
@@ -905,7 +908,7 @@ function! s:zen_parseIntoTree(abbr, type)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let abbr = substitute(abbr, '\([a-zA-Z][a-zA-Z0-9]*\)+\([()]\|$\)', '\="(".s:zen_expandos(type, submatch(1)).")".submatch(2)', 'i')
|
let abbr = substitute(abbr, '\([a-zA-Z][a-zA-Z0-9]*\)+\([()]\|$\)', '\="(".s:zen_expandos(type, submatch(1)).")".submatch(2)', 'i')
|
||||||
let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)'
|
let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[{}a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[{}a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)'
|
||||||
let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
|
let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
|
||||||
let parent = root
|
let parent = root
|
||||||
let last = root
|
let last = root
|
||||||
@@ -980,7 +983,7 @@ function! s:zen_parseIntoTree(abbr, type)
|
|||||||
if len(attributes)
|
if len(attributes)
|
||||||
let attr = attributes
|
let attr = attributes
|
||||||
while len(attr)
|
while len(attr)
|
||||||
let item = matchstr(attr, '\(\%(\%(#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[a-zA-Z0-9_\-\$]\+\)*\)\)')
|
let item = matchstr(attr, '\(\%(\%(#[{}a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[{}a-zA-Z0-9_\-\$]\+\)*\)\)')
|
||||||
if len(item) == 0
|
if len(item) == 0
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user