mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 11:14:26 +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:
|
||||
|
||||
@@ -846,6 +846,9 @@ let s:zen_settings = {
|
||||
\ },
|
||||
\ 'xhtml': {
|
||||
\ 'extends': 'html'
|
||||
\ },
|
||||
\ 'mustache': {
|
||||
\ 'extends': 'html'
|
||||
\ }
|
||||
\}
|
||||
|
||||
@@ -905,7 +908,7 @@ function! s:zen_parseIntoTree(abbr, type)
|
||||
endif
|
||||
|
||||
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 parent = root
|
||||
let last = root
|
||||
@@ -980,7 +983,7 @@ function! s:zen_parseIntoTree(abbr, type)
|
||||
if len(attributes)
|
||||
let attr = attributes
|
||||
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
|
||||
break
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user