diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 786ee48..17b9cd8 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -200,7 +200,8 @@ function! s:highlight_existing_links() "{{{ " Conditional highlighting that depends on the existence of a wiki file or " directory is only available for *schemeless* wiki links " Links are set up upon BufEnter (see plugin/...) - let safe_links = vimwiki#base#file_pattern(b:existing_wikifiles) + let safe_links = '\%('.vimwiki#base#file_pattern(b:existing_wikifiles) . + \ '\%(#[^|]*\)\?\|#[^|]*\)' " Wikilink Dirs set up upon BufEnter (see plugin/...) let safe_dirs = vimwiki#base#file_pattern(b:existing_wikidirs) diff --git a/syntax/vimwiki_markdown_custom.vim b/syntax/vimwiki_markdown_custom.vim index 502ebdd..af9ab96 100644 --- a/syntax/vimwiki_markdown_custom.vim +++ b/syntax/vimwiki_markdown_custom.vim @@ -242,7 +242,8 @@ function! s:highlight_existing_links() "{{{ " Conditional highlighting that depends on the existence of a wiki file or " directory is only available for *schemeless* wiki links " Links are set up upon BufEnter (see plugin/...) - let safe_links = vimwiki#base#file_pattern(b:existing_wikifiles) + let safe_links = '\%('.vimwiki#base#file_pattern(b:existing_wikifiles) . + \ '\%(#[^|]*\)\?\|#[^|]*\)' " Wikilink1 Dirs set up upon BufEnter (see plugin/...) let safe_dirs = vimwiki#base#file_pattern(b:existing_wikidirs) " Ref links are cached