From 1cffbdbf3d668518a8af2dcbff681f77977a0b83 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Fri, 25 Jan 2019 16:45:11 +0100 Subject: [PATCH] Fix: Don't double a ' character in header in TOC When building the TOC, every ' in a header got doubled. According to git blame, I did this doubling explicitely, but I have no idea why I did this. --- autoload/vimwiki/base.vim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 829df58..ca56f17 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1856,15 +1856,14 @@ function! vimwiki#base#table_of_contents(create) let indentstring = repeat(' ', vimwiki#u#sw()) let bullet = vimwiki#lst#default_symbol().' ' for [lvl, link, desc] in complete_header_infos - let esc_link = substitute(link, "'", "''", 'g') - let esc_desc = substitute(desc, "'", "''", 'g') - let link_tpl = vimwiki#vars#get_global('WikiLinkTemplate2') if vimwiki#vars#get_wikilocal('syntax') == 'markdown' let link_tpl = vimwiki#vars#get_syntaxlocal('Weblink1Template') + else + let link_tpl = vimwiki#vars#get_global('WikiLinkTemplate2') endif let link = s:safesubstitute(link_tpl, '__LinkUrl__', - \ '#'.esc_link, '') - let link = s:safesubstitute(link, '__LinkDescription__', esc_desc, '') + \ '#'.link, '') + let link = s:safesubstitute(link, '__LinkDescription__', desc, '') call add(lines, startindent.repeat(indentstring, lvl-1).bullet.link) endfor