mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 03:04:27 +08:00
Unique attribute names. close #119
This commit is contained in:
@@ -26,7 +26,7 @@ function! zencoding#lang#haml#toString(settings, current, type, inline, filters,
|
|||||||
if len(current.name) > 0
|
if len(current.name) > 0
|
||||||
let str .= '%' . current_name
|
let str .= '%' . current_name
|
||||||
let tmp = ''
|
let tmp = ''
|
||||||
for attr in current.attrs_order
|
for attr in zencoding#util#unique(current.attrs_order)
|
||||||
if !has_key(current.attr, attr)
|
if !has_key(current.attr, attr)
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters,
|
|||||||
endif
|
endif
|
||||||
if len(current_name) > 0
|
if len(current_name) > 0
|
||||||
let str .= '<' . current_name
|
let str .= '<' . current_name
|
||||||
for attr in current.attrs_order
|
for attr in zencoding#util#unique(current.attrs_order)
|
||||||
if !has_key(current.attr, attr)
|
if !has_key(current.attr, attr)
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function! zencoding#lang#slim#toString(settings, current, type, inline, filters,
|
|||||||
endif
|
endif
|
||||||
if len(current.name) > 0
|
if len(current.name) > 0
|
||||||
let str .= current_name
|
let str .= current_name
|
||||||
for attr in current.attrs_order
|
for attr in zencoding#util#unique(current.attrs_order)
|
||||||
if !has_key(current.attr, attr)
|
if !has_key(current.attr, attr)
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -247,3 +247,15 @@ function! zencoding#util#isImageMagickInstalled()
|
|||||||
endif
|
endif
|
||||||
return executable('identify')
|
return executable('identify')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! zencoding#util#unique(arr)
|
||||||
|
let m = {}
|
||||||
|
let r = []
|
||||||
|
for i in a:arr
|
||||||
|
if !has_key(m, i)
|
||||||
|
let m[i] = 1
|
||||||
|
call add(r, i)
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
return r
|
||||||
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user