mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 03:04:27 +08:00
Fix order of attributes. close #117
This commit is contained in:
@@ -138,7 +138,7 @@ function! zencoding#lang#haml#encodeImage()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zencoding#lang#haml#parseTag(tag)
|
function! zencoding#lang#haml#parseTag(tag)
|
||||||
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': ['id', 'class'] }
|
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': [] }
|
||||||
let mx = '%\([a-zA-Z][a-zA-Z0-9]*\)\s*\%({\(.*\)}\)'
|
let mx = '%\([a-zA-Z][a-zA-Z0-9]*\)\s*\%({\(.*\)}\)'
|
||||||
let match = matchstr(a:tag, mx)
|
let match = matchstr(a:tag, mx)
|
||||||
let current.name = substitute(match, mx, '\1', 'i')
|
let current.name = substitute(match, mx, '\1', 'i')
|
||||||
@@ -153,9 +153,9 @@ function! zencoding#lang#haml#parseTag(tag)
|
|||||||
let name = attr_match[1]
|
let name = attr_match[1]
|
||||||
let value = len(attr_match[2]) ? attr_match[2] : attr_match[3]
|
let value = len(attr_match[2]) ? attr_match[2] : attr_match[3]
|
||||||
let current.attr[name] = value
|
let current.attr[name] = value
|
||||||
|
let current.attrs_order += [name]
|
||||||
let attrs = attrs[stridx(attrs, match) + len(match):]
|
let attrs = attrs[stridx(attrs, match) + len(match):]
|
||||||
endwhile
|
endwhile
|
||||||
let current.attrs_order = keys(current.attr)
|
|
||||||
return current
|
return current
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ function! zencoding#lang#html#encodeImage()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zencoding#lang#html#parseTag(tag)
|
function! zencoding#lang#html#parseTag(tag)
|
||||||
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': ['id', 'class'] }
|
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': [] }
|
||||||
let mx = '<\([a-zA-Z][a-zA-Z0-9]*\)\(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\%([^"'' \t]\+\|"[^"]\{-}"\|''[^'']\{-}''\)\s*\)*\)\(/\{0,1}\)>'
|
let mx = '<\([a-zA-Z][a-zA-Z0-9]*\)\(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\%([^"'' \t]\+\|"[^"]\{-}"\|''[^'']\{-}''\)\s*\)*\)\(/\{0,1}\)>'
|
||||||
let match = matchstr(a:tag, mx)
|
let match = matchstr(a:tag, mx)
|
||||||
let current.name = substitute(match, mx, '\1', 'i')
|
let current.name = substitute(match, mx, '\1', 'i')
|
||||||
@@ -469,9 +469,9 @@ function! zencoding#lang#html#parseTag(tag)
|
|||||||
let name = attr_match[1]
|
let name = attr_match[1]
|
||||||
let value = len(attr_match[2]) ? attr_match[2] : attr_match[3]
|
let value = len(attr_match[2]) ? attr_match[2] : attr_match[3]
|
||||||
let current.attr[name] = value
|
let current.attr[name] = value
|
||||||
|
let current.attrs_order += [name]
|
||||||
let attrs = attrs[stridx(attrs, match) + len(match):]
|
let attrs = attrs[stridx(attrs, match) + len(match):]
|
||||||
endwhile
|
endwhile
|
||||||
let current.attrs_order = keys(current.attr)
|
|
||||||
return current
|
return current
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ function! zencoding#lang#slim#encodeImage()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! zencoding#lang#slim#parseTag(tag)
|
function! zencoding#lang#slim#parseTag(tag)
|
||||||
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': ['id', 'class'] }
|
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': [] }
|
||||||
let mx = '\([a-zA-Z][a-zA-Z0-9]*\)\s\+\(.*\)'
|
let mx = '\([a-zA-Z][a-zA-Z0-9]*\)\s\+\(.*\)'
|
||||||
let match = matchstr(a:tag, mx)
|
let match = matchstr(a:tag, mx)
|
||||||
let current.name = substitute(match, mx, '\1', 'i')
|
let current.name = substitute(match, mx, '\1', 'i')
|
||||||
@@ -131,9 +131,9 @@ function! zencoding#lang#slim#parseTag(tag)
|
|||||||
let name = attr_match[1]
|
let name = attr_match[1]
|
||||||
let value = len(attr_match[2]) ? attr_match[2] : attr_match[3]
|
let value = len(attr_match[2]) ? attr_match[2] : attr_match[3]
|
||||||
let current.attr[name] = value
|
let current.attr[name] = value
|
||||||
|
let current.attrs_order += [name]
|
||||||
let attrs = attrs[stridx(attrs, match) + len(match):]
|
let attrs = attrs[stridx(attrs, match) + len(match):]
|
||||||
endwhile
|
endwhile
|
||||||
let current.attrs_order = keys(current.attr)
|
|
||||||
return current
|
return current
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user