fix skipping tags.

This commit is contained in:
mattn
2012-05-30 19:22:26 +09:00
parent 14fb367409
commit 57e43e4833

View File

@@ -8,9 +8,14 @@ let s:mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#.]\{-}[a-zA-Z\!][a-zA-Z0-9:_\!
function! zencoding#lang#html#findTokens(str) function! zencoding#lang#html#findTokens(str)
let str = a:str let str = a:str
let [pos, last_pos] = [0, 0] let [pos, last_pos] = [0, 0]
while str =~ '<.\{-}>' while 1
let str = substitute(str, '^.*<.\{-}>', '', '') let tag = matchstr(str, '<.\{-}>', pos)
if len(tag) == 0
break
endif
let pos = stridx(str, tag, pos) + len(tag)
endwhile endwhile
let last_pos = pos
while len(str) > 0 while len(str) > 0
let token = matchstr(str, s:mx, pos) let token = matchstr(str, s:mx, pos)
if token == '' if token == ''