Fixes #329 again

This commit is contained in:
Yasuhiro Matsumoto
2016-05-10 10:00:18 +09:00
parent 8239822548
commit 05bfff176b
2 changed files with 15 additions and 6 deletions

View File

@@ -332,6 +332,7 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
if operator =~# '>' if operator =~# '>'
let last.pos += 1 let last.pos += 1
endif endif
let last.block = 1
for n in range(len(block_start)) for n in range(len(block_start))
let pos += [last.pos] let pos += [last.pos]
endfor endfor
@@ -353,10 +354,15 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
let last = parent let last = parent
let last.pos += 1 let last.pos += 1
endif endif
elseif n =~ '^*[0-9]\+$'
let last.child[-1].multiplier = 0 + n[1:]
elseif len(n) elseif len(n)
let cl = last.child let start = 0
for nc in range(len(last.child))
if has_key(last.child[nc], 'block')
let start = nc
break
endif
endfor
let cl = last.child[nc:]
let cls = [] let cls = []
for c in range(n[1:]) for c in range(n[1:])
for cc in cl for cc in cl
@@ -368,7 +374,11 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
endfor endfor
let cls += deepcopy(cl) let cls += deepcopy(cl)
endfor endfor
let last.child = cls if nc > 0
let last.child = last.child[:nc-1] + cls
else
let last.child = cls
endif
endif endif
endfor endfor
endif endif

View File

@@ -542,8 +542,7 @@ finish
}, },
{ {
'query': "form>fieldset>legend+(label>input[type=\"checkbox\"])*3", 'query': "form>fieldset>legend+(label>input[type=\"checkbox\"])*3",
'result': "<form action=\"\">\t<fieldset>\t\t<legend></legend>\t\t<label for=\"\"><input type=\"checkbox\"></label>\t\t<label for=\"\"><input type=\"checkbox\"></label>\t\t<label for=\"\"><input type=\"checkbox\"></label>\t</fieldset></form>", 'result': "<form action=\"\">\n\t<fieldset>\n\t\t<legend></legend>\n\t\t<label for=\"\"><input type=\"checkbox\"></label>\n\t\t<label for=\"\"><input type=\"checkbox\"></label>\n\t\t<label for=\"\"><input type=\"checkbox\"></label>\n\t</fieldset>\n</form>\n",
'ignore': 1,
}, },
], ],
}, },