Skip to content

Commit 862fa82

Browse files
committed
use [:space:] to recognize \n just after a tag name. also fixed feed parser.
1 parent 9da4cab commit 862fa82

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

autoload/webapi/feed.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function! webapi#feed#parseURL(url)
2828
call add(items, {
2929
\ "title": s:attr(item, 'title'),
3030
\ "link": s:attr(item, 'link'),
31-
\ "content": : s:attr(item, 'description'),
31+
\ "content": s:attr(item, 'description'),
3232
\ "id": s:attr(item, 'guid'),
3333
\ "date": s:attr(item, 'dc:date'),
3434
\})

autoload/webapi/xml.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ function! s:parse_tree(ctx, top)
217217
" 7) text content of CDATA
218218
" 8) the remaining text after the tag (rest)
219219
" (These numbers correspond to the indexes in matched list m)
220-
"let tag_mx = '^\(\_.\{-}\)\%(\%(<\(/\?\)\([^ !/\t\r\n>]\+\)\(\%([ \t\r\n]*[^ />\t\r\n=]\+[ \t\r\n]*\%(=[ \t\r\n]*\%([^"'' >\t]\+\|"[^"]*"\|''[^'']*''\)\)\)*\)[ \t\r\n]*\(/\?\)>\)\|\%(<!\[\(CDATA\)\[\(.\{-}\)\]\]>\)\|\(<!--.\{-}-->\)\)\(.*\)'
221-
let tag_mx = '^\(\_.\{-}\)\%(\%(<\(/\?\)\([^ !/\t\r\n>]\+\)\(\%([ \t\r\n]*[^ />\t\r\n=]\+[ \t\r\n]*=[ \t\r\n]*\%([^"'' >\t]\+\|"[^"]*"\|''[^'']*''\)\|[ \t\r\n]\+[^ />\t\r\n=]\+[ \t\r\n]*\)*\)[ \t\r\n]*\(/\?\)>\)\|\%(<!\[\(CDATA\)\[\(.\{-}\)\]\]>\)\|\(<!--.\{-}-->\)\)\(.*\)'
220+
let tag_mx = '^\(\_.\{-}\)\%(\%(<\(/\?\)\([^!/>[:space:]]\+\)\(\%([[:space:]]*[^/>=[:space:]]\+[[:space:]]*=[[:space:]]*\%([^"'' >\t]\+\|"[^"]*"\|''[^'']*''\)\|[[:space:]]\+[^/>=[:space:]]\+[[:space:]]*\)*\)[[:space:]]*\(/\?\)>\)\|\%(<!\[\(CDATA\)\[\(.\{-}\)\]\]>\)\|\(<!--.\{-}-->\)\)\(.*\)'
222221

223222
while len(a:ctx['xml']) > 0
224223
let m = matchlist(a:ctx.xml, tag_mx)
@@ -258,7 +257,7 @@ function! s:parse_tree(ctx, top)
258257

259258
let node = deepcopy(s:template)
260259
let node.name = tag_name
261-
let attr_mx = '\([^ \t\r\n=]\+\)\s*\%(=\s*''\([^'']*\)''\|=\s*"\([^"]*\)"\|=\s*\(\w\+\)\|\)'
260+
let attr_mx = '\([^=[:space:]]\+\)\s*\%(=\s*''\([^'']*\)''\|=\s*"\([^"]*\)"\|=\s*\(\w\+\)\|\)'
262261
while len(attrs) > 0
263262
let attr_match = matchlist(attrs, attr_mx)
264263
if len(attr_match) == 0

0 commit comments

Comments
 (0)