Feature: Markdown link: VimwikiTOC supports multiple heading with same name (Issue: #968, 666, #664)

Anchor can be suffixed with -1 -2 according to the heading number (in
file) user want to reach.
Implemented with a dictionary for caching anchor names (without sufix)
This commit is contained in:
Tinmarino
2020-08-02 23:10:44 -04:00
parent a27940a394
commit 428c60a45e
2 changed files with 124 additions and 33 deletions

View File

@ -1,5 +1,6 @@
# VimwikiTOC {{{1
#
# TODO implement: If link in the heading (see README.md)
# TODO (10min) test if g:vimwiki_to_header well readen
# TODO (10min) test vimviki_toc_link_format
# TODO (1h) test if really wiki dependant (for 2 diffrent wikis)
@ -10,21 +11,52 @@
# -- 3. changes any space to a hyphen => OK: from previous big
# -- 4. If that is not unique, add "-1", "-2", "-3",... to make it unique => TODO not implemented
#
#
# TODO if link in heading
#Given vimwiki (Two same heading {{{1):
# # Pre [link](anything no parenthesis) Post
#
#Execute (Set syntax markdown && Set sw=8):
# call SetSyntax('markdown')
# set sw=8
# VimwikiTOC
#
#Expect (Suffix -1 and -2):
#
#
#
#
# Start {{{1
" TODO
"Given vimwiki (Two same heading {{{1):
" # One
" ## two
" ## Two
"
"Execute (Set syntax markdown && Set sw=8):
" call SetSyntax('markdown')
" set sw=8
" VimwikiTOC
"
"Expect (Suffix -1 and -2):
"
Given vimwiki (Two same heading (#968) {{{1):
# One
toto
# ONE
like
## oNe
you
Execute (Set syntax markdown && Set sw=8):
call SetSyntax('markdown')
set sw=8
VimwikiTOC
Expect (Suffix -2 and -3):
# Contents
- [One](#one)
- [ONE](#one-2)
- [oNe](#one-3)
# One
toto
# ONE
like
## oNe
you
Given vimwiki (Heading with many bad caracters {{{1):
# One !@#@#(!%#&$^(!@