fix duplicate tag issue #1326
This commit is contained in:
@@ -123,15 +123,12 @@ function! s:scan_tags(lines, page_name) abort
|
|||||||
|
|
||||||
" Scan line for tags. There can be many of them.
|
" Scan line for tags. There can be many of them.
|
||||||
let str = line
|
let str = line
|
||||||
while 1
|
|
||||||
" Get all matches
|
" Get all matches
|
||||||
let tag_groups = []
|
let tag_groups = []
|
||||||
call substitute(str, tag_search_rx, '\=add(tag_groups, submatch(0))', 'g')
|
call substitute(str, tag_search_rx, '\=add(tag_groups, submatch(0))', 'g')
|
||||||
if tag_groups == []
|
if tag_groups == []
|
||||||
break
|
continue
|
||||||
endif
|
endif
|
||||||
let tagend = matchend(str, tag_search_rx)
|
|
||||||
let str = str[(tagend):]
|
|
||||||
for tag_group in tag_groups
|
for tag_group in tag_groups
|
||||||
for tag in split(tag_group, tag_format.sep)
|
for tag in split(tag_group, tag_format.sep)
|
||||||
" Create metadata entry
|
" Create metadata entry
|
||||||
@@ -154,7 +151,6 @@ function! s:scan_tags(lines, page_name) abort
|
|||||||
call add(entries, entry)
|
call add(entries, entry)
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
endwhile
|
|
||||||
|
|
||||||
endfor " loop over lines
|
endfor " loop over lines
|
||||||
return entries
|
return entries
|
||||||
|
|||||||
Reference in New Issue
Block a user