diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index 636abf3..8c0ac9e 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -1,7 +1,7 @@ "============================================================================= " zencoding.vim " Author: Yasuhiro Matsumoto -" Last Change: 22-Sep-2011. +" Last Change: 26-Sep-2011. let s:save_cpo = &cpo set cpo&vim @@ -779,7 +779,7 @@ function! zencoding#imageSize() if filereadable(fn) let hex = substitute(system('xxd -p "'.fn.'"'), '\n', '', 'g') else - let hex = substitute(system('curl -s "'.fn.'" | xxd -p'), '\n', '', 'g') + let hex = substitute(system(g:zencoding_curl_command.' "'.fn.'" | xxd -p'), '\n', '', 'g') endif if hex =~ '^89504e470d0a1a0a' @@ -1089,7 +1089,7 @@ endfunction "============================================================================== function! s:get_content_from_url(url) silent! new - silent! exec '0r!curl -s -L "'.substitute(a:url, '#.*', '', '').'"' + silent! exec '0r!'.g:zencoding_curl_command.' "'.substitute(a:url, '#.*', '', '').'"' let ret = join(getline(1, '$'), "\n") silent! bw! return ret @@ -1110,7 +1110,7 @@ function! s:get_text_from_html(buf) let m = split(buf, mx) for str in m let c = split(str, '<[^>]*?>') - let str = substitute(str, '<[^>]\{-}>', '', 'g') + let str = substitute(str, '<[^>]\{-}>', ' ', 'g') let str = substitute(str, '>', '>', 'g') let str = substitute(str, '<', '<', 'g') let str = substitute(str, '"', '"', 'g') @@ -1124,8 +1124,8 @@ function! s:get_text_from_html(buf) if l > threshold_len let per = len(c) / l if max < l && per < threshold_per - let max = l - let res = str + let max = l + let res = str endif endif endfor diff --git a/plugin/zencoding.vim b/plugin/zencoding.vim index ddd4770..99591f4 100644 --- a/plugin/zencoding.vim +++ b/plugin/zencoding.vim @@ -1,7 +1,7 @@ "============================================================================= " File: zencoding.vim " Author: Yasuhiro Matsumoto -" Last Change: 22-Sep-2011. +" Last Change: 26-Sep-2011. " Version: 0.54 " WebPage: http://github.com/mattn/zencoding-vim " Description: vim plugins for HTML and CSS hi-speed coding. @@ -78,6 +78,10 @@ if !exists('g:zencoding_debug') let g:zencoding_debug = 0 endif +if !exists('g:zencoding_curl_command') + let g:zencoding_curl_command = 'curl -s -L' +endif + if exists('g:use_zen_complete_tag') && g:use_zen_complete_tag setlocal omnifunc=zencoding#CompleteTag endif