mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 10:44:24 +08:00
fix parsing #{{foo}} and .{{bar}}
This commit is contained in:
@@ -62,7 +62,7 @@ function! s:zen_parseIntoTree(abbr, type)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let abbr = substitute(abbr, '\([a-zA-Z][a-zA-Z0-9]*\)+\([()]\|$\)', '\="(".s:zen_getExpandos(type, submatch(1)).")".submatch(2)', 'i')
|
let abbr = substitute(abbr, '\([a-zA-Z][a-zA-Z0-9]*\)+\([()]\|$\)', '\="(".s:zen_getExpandos(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_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.{[{}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
|
||||||
@@ -1279,6 +1279,7 @@ function! zencoding#ExpandWord(abbr, type, orig)
|
|||||||
endfor
|
endfor
|
||||||
if a:orig == 0
|
if a:orig == 0
|
||||||
let expand = substitute(expand, '\${lang}', s:zen_settings.lang, 'g')
|
let expand = substitute(expand, '\${lang}', s:zen_settings.lang, 'g')
|
||||||
|
let expand = substitute(expand, '\${charset}', s:zen_settings.charset, 'g')
|
||||||
let expand = substitute(expand, '\${cursor}', '', 'g')
|
let expand = substitute(expand, '\${cursor}', '', 'g')
|
||||||
endif
|
endif
|
||||||
return expand
|
return expand
|
||||||
|
|||||||
@@ -406,6 +406,12 @@ finish
|
|||||||
'type': "html",
|
'type': "html",
|
||||||
'result': "<a rel=\"\" href=\"\" title=\"Hello', world\"></a>\n",
|
'result': "<a rel=\"\" href=\"\" title=\"Hello', world\"></a>\n",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': "div>a#foo{bar}",
|
||||||
|
'query': "div>a#foo{bar}",
|
||||||
|
'type': "html",
|
||||||
|
'result': "<div>\n\t<a id=\"foo\" href=\"\">bar</a>\n</div>\n",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user