From 8167c65499bb2eb9bdfd6658b5e02952d681a1eb Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 13 Mar 2014 16:33:39 +0100 Subject: [PATCH] Fix appending '#' to links Ref #40 --- autoload/vimwiki/html.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index bf300ec..71bd126 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -417,8 +417,11 @@ function! s:tag_wikilink(value) "{{{ if g:vimwiki_debug > 1 echom '[[idx='.idx.', scheme='.scheme.', path='.path.', subdir='.subdir.', lnk='.lnk.', ext='.ext.']]' endif - let anchor = substitute(anchor, '#', '-', 'g') - let line = vimwiki#html#linkify_link(url.'#'.anchor, descr) + if anchor != '' + let anchor = substitute(anchor, '#', '-', 'g') + let url .= '#'.anchor + endif + let line = vimwiki#html#linkify_link(url, descr) return line endfunction "}}} "}}}