Feature: Follow links: Allow hyphens and case-insensitive (PR #840 from @bratekarate)

Brief: Permits:

```
[Link to heading](#heading-example)
```

Issue: Feature Request: Support GFM anchor links inside wiki files #831
Original PR: Allow hyphens instead of spaces and search case-insensitive in jump_to_anchor function #840
Author: @bratekarate (implementation) @tinmarino (test)

Related: #666
This commit is contained in:
Tinmarino
2020-07-30 00:45:28 -04:00
parent 2332dc1514
commit 355c1f76b0
2 changed files with 51 additions and 0 deletions

View File

@ -1,4 +1,40 @@
# Link internal to a file
# See issue #666 for anchor support (then internal links)
# Link to anchor with spaces {{{!
# PR #840
# Issues: #831
Given vimwiki (Internal links zith spaces):
[Any ! apparent name @#$](#basic-heading-many-spaces)
One line here
## Basic HeAding Many SpacES
One line here
Execute (Set markdown):
file wiki_test.md
call SetSyntax('markdown')
Do (Enter link):
\<Cr>
A__HERE__\<Esc>
Expect (Cursor at heading position):
[Any ! apparent name @#$](#basic-heading-many-spaces)
One line here
## Basic HeAding Many SpacES__HERE__
One line here
Execute (Clear wiki jumps (alias: prev_links)):
call vimwiki#vars#set_bufferlocal('prev_links', [])
# Before {{{1
Given vimwiki (Internal links + one link to filenew):
# Contents
@ -220,3 +256,5 @@ Expect (Some chars appended at self link):
- [ this_is_18_chars My own file](wiki_test)
- [Test1](#Test1)
- [Test2](#Test2)
# vim: foldmethod=marker foldlevel=30 sw=2