aboutsummaryrefslogtreecommitdiff
path: root/test/vimwiki-reader.native
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-04-05 10:04:28 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-04-05 10:04:28 -0700
commit4f572ddf6941b8fb0ad7a5835216c708998444f0 (patch)
treea0c0301e199b27fce20a001895c75f0b3be5854d /test/vimwiki-reader.native
parentba7898bb3dae98c14ae824eab3129f22a70e6bd3 (diff)
downloadpandoc-4f572ddf6941b8fb0ad7a5835216c708998444f0.tar.gz
Vimwiki reader: improve handling of internal links.
1) Don't append `.html` 2) Add `wikilink` title This mirrors behavior of other wiki readers. Generally the `.html` extension is not wanted. It may be important for output to HTML in certain circumstances, but it can always be added using a filter that matches on links with title `wikilink`. Note that if you have a workflow that uses pandoc to convert vimwiki to readable HTML pages, you may need to add such a filter to reproduce current behavior. Here is a filter that does the job: ```lua function Link(el) if el.title == 'wikilink' then el.target = el.target .. ".html" end return el end ``` Save this as `fixlinks.lua` and use with `--lua-filter fixlinks.lua`. Closes #5414.
Diffstat (limited to 'test/vimwiki-reader.native')
-rw-r--r--test/vimwiki-reader.native16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/vimwiki-reader.native b/test/vimwiki-reader.native
index 2d720cc7e..3df91bec5 100644
--- a/test/vimwiki-reader.native
+++ b/test/vimwiki-reader.native
@@ -62,14 +62,14 @@ Pandoc (Meta {unMeta = fromList [("date",MetaInlines [Str "2017-05-01"]),("title
,Para [Link ("",[],[]) [Str "email",Space,Str "me"] ("mailto:info@example.org","")]
,Para [Link ("",[],[]) [Str "mailto:hello@bye.com"] ("mailto:hello@bye.com","")]
,Header 2 ("internal links",[],[]) [Str "internal",Space,Str "links"]
-,Para [Link ("",[],[]) [Str "This is a link"] ("This is a link.html","")]
-,Para [Link ("",[],[]) [Str "Description",Space,Str "of",Space,Str "the",Space,Str "link"] ("This is a link source.html","")]
-,Para [Link ("",[],[]) [Str "projects/Important Project 1"] ("projects/Important Project 1.html",""),SoftBreak,Link ("",[],[]) [Str "../index"] ("../index.html",""),SoftBreak,Link ("",[],[]) [Str "Other",Space,Str "files"] ("a subdirectory/","")]
-,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "tag",Space,Str "anchors"] ("#tag-one","")]
-,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "header",Space,Str "anchors"] ("#block quotes","")]
-,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "strong",Space,Str "anchors"] ("#strong","")]
-,Para [Link ("",[],[]) [Str "Tasks",Space,Str "for",Space,Str "tomorrow"] ("Todo List.html#Tomorrow","")]
-,Para [Link ("",[],[]) [Str "diary:2017-05-01"] ("diary/2017-05-01.html","")]
+,Para [Link ("",[],[]) [Str "This is a link"] ("This is a link","wikilink")]
+,Para [Link ("",[],[]) [Str "Description",Space,Str "of",Space,Str "the",Space,Str "link"] ("This is a link source","wikilink")]
+,Para [Link ("",[],[]) [Str "projects/Important Project 1"] ("projects/Important Project 1","wikilink"),SoftBreak,Link ("",[],[]) [Str "../index"] ("../index","wikilink"),SoftBreak,Link ("",[],[]) [Str "Other",Space,Str "files"] ("a subdirectory/","wikilink")]
+,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "tag",Space,Str "anchors"] ("#tag-one","wikilink")]
+,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "header",Space,Str "anchors"] ("#block quotes","wikilink")]
+,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "strong",Space,Str "anchors"] ("#strong","wikilink")]
+,Para [Link ("",[],[]) [Str "Tasks",Space,Str "for",Space,Str "tomorrow"] ("Todo List#Tomorrow","wikilink")]
+,Para [Link ("",[],[]) [Str "diary:2017-05-01"] ("diary/2017-05-01","wikilink")]
,Para [Link ("",[],[]) [Str "Important",Space,Str "Data"] ("file:../assets/data.csv","")]
,Header 3 ("links with thumbnails",[],[]) [Str "links",Space,Str "with",Space,Str "thumbnails"]
,Para [Link ("",[],[]) [Image ("",[],[]) [Str ""] ("./movie.jpg","")] ("http://www.google.com","")]