Ignore verbatim blocks when scanning tags.

Merge pull request #672.
This commit is contained in:
Rane Brown 2020-01-03 15:24:47 -07:00
parent 270f542292
commit 87c13f570a

View File

@ -88,6 +88,11 @@ function! s:scan_tags(lines, page_name) abort
for line_nr in range(1, len(a:lines)) for line_nr in range(1, len(a:lines))
let line = a:lines[line_nr - 1] let line = a:lines[line_nr - 1]
" ignore verbatim blocks
if vimwiki#u#is_codeblock(line_nr)
continue
endif
" process headers " process headers
let h_match = matchlist(line, rxheader) let h_match = matchlist(line, rxheader)
if !empty(h_match) " got a header if !empty(h_match) " got a header
@ -112,8 +117,6 @@ function! s:scan_tags(lines, page_name) abort
continue " tags are not allowed in headers continue " tags are not allowed in headers
endif endif
" TODO ignore verbatim blocks
" 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 while 1