From 91a73a3e1020bd28b906757c582216e62f2fec61 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 29 Nov 2023 08:31:55 -1000 Subject: [PATCH] wikilinks.lua cleanup --- fixwikilinks.lua => wikilinks.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename fixwikilinks.lua => wikilinks.lua (62%) diff --git a/fixwikilinks.lua b/wikilinks.lua similarity index 62% rename from fixwikilinks.lua rename to wikilinks.lua index 8cf3220..b672477 100644 --- a/fixwikilinks.lua +++ b/wikilinks.lua @@ -1,10 +1,9 @@ --- Pandoc's wikilinks_title_after_pipe extension makes a start at linking --- [[bracketed wiki links]]. This lua filter does the rest, mimicking +-- Pandoc's wikilinks_title_after_pipe extension does basic hyperlinking +-- of [[bracketed wiki links]]. This lua filter does the rest, mimicking -- Obsidian's wiki linking where possible. It --- - hyphen-replaces problem characters in the uri --- - adds ".html" to the uri path --- - preserves the uri fragment if any --- - lower-cases the uri fragment +-- - replaces spaces with hyphens in the uri path and fragment +-- - adds ".html" to the path (preserving any fragment) +-- - lower-cases the fragment function Link(elem) if elem.title == "wikilink" then