mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 03:04:27 +08:00
Fix parse image size
This commit is contained in:
@@ -136,7 +136,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 }
|
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': ['id', 'class'] }
|
||||||
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')
|
||||||
|
|||||||
@@ -114,7 +114,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 }
|
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': ['id', 'class'] }
|
||||||
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')
|
||||||
|
|||||||
@@ -235,9 +235,9 @@ endfunction
|
|||||||
|
|
||||||
function! zencoding#util#imageSizeWithImageMagick(fn)
|
function! zencoding#util#imageSizeWithImageMagick(fn)
|
||||||
let img_info = system('identify -format "%wx%h" "'.a:fn.'"')
|
let img_info = system('identify -format "%wx%h" "'.a:fn.'"')
|
||||||
let img_size = split(img_info, 'x')
|
let img_size = split(substitute(img_info, '\n', '', ''), 'x')
|
||||||
let width = img_size[0]
|
let width = img_size[0]
|
||||||
let height = substitute(img_size[1], '\n', '', '')
|
let height = img_size[1]
|
||||||
return [width, height]
|
return [width, height]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user