From 0d96516ed37f08dea502575b84d79892ba9d7e95 Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 8 Mar 2010 19:00:42 +0900 Subject: [PATCH] fixed title. and trim strings. --- zencoding.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zencoding.vim b/zencoding.vim index bb33f31..ee2f456 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -1531,6 +1531,7 @@ function! s:getTextFromHTML(buf) let buf = a:buf let buf = strpart(buf, stridx(buf, '')) + let buf = substitute(buf, '', '', 'g') let res = '' let max = 0 let mx = '\(]\{-}>\)\|\(<\/td>\)\|\(]\{-}>\)\|\(<\/div>\)' @@ -1545,6 +1546,8 @@ function! s:getTextFromHTML(buf) let str = substitute(str, ' ', ' ', 'g') let str = substitute(str, '¥', '\¥', 'g') let str = substitute(str, '&', '\&', 'g') + let str = substitute(str, '^\s*\(.*\)\s*$', '\1', '') + let str = substitute(str, '\s\+', ' ', 'g') let l = len(str) if l > threshold_len let per = len(c) / l @@ -1554,6 +1557,7 @@ function! s:getTextFromHTML(buf) endif endif endfor + let res = substitute(res, '^\s*\(.*\)\s*$', '\1', 'g') return res endfunction @@ -1576,7 +1580,7 @@ function! s:zen_anchorizeURL(flag) if a:flag == 0 let a = s:zen_parseTag('') let a.attr['href'] = url - let a.value = title + let a.value = '{' . title . '}' let expand = s:zen_toString(a, 'html', 0, '') else let body = strpart(content, stridx(content, ''))