Use markdown link syntax for the TOC

Ref #483
Fix #200
This commit is contained in:
Zhuang Ma 2018-05-02 03:22:07 +08:00 committed by EinfachToll
parent 66a565d388
commit c8b02e4bc5

View File

@ -1816,7 +1816,11 @@ function! vimwiki#base#table_of_contents(create)
for [lvl, link, desc] in complete_header_infos for [lvl, link, desc] in complete_header_infos
let esc_link = substitute(link, "'", "''", 'g') let esc_link = substitute(link, "'", "''", 'g')
let esc_desc = substitute(desc, "'", "''", 'g') let esc_desc = substitute(desc, "'", "''", 'g')
let link = s:safesubstitute(vimwiki#vars#get_global('WikiLinkTemplate2'), '__LinkUrl__', let link_tpl = vimwiki#vars#get_global('WikiLinkTemplate2')
if vimwiki#vars#get_wikilocal('syntax') == 'markdown'
let link_tpl = vimwiki#vars#get_syntaxlocal('Weblink1Template')
endif
let link = s:safesubstitute(link_tpl, '__LinkUrl__',
\ '#'.esc_link, '') \ '#'.esc_link, '')
let link = s:safesubstitute(link, '__LinkDescription__', esc_desc, '') let link = s:safesubstitute(link, '__LinkDescription__', esc_desc, '')
call add(lines, startindent.repeat(indentstring, lvl-1).bullet.link) call add(lines, startindent.repeat(indentstring, lvl-1).bullet.link)