From 4733aef8d345331cd59349f4ba3b243c1d662551 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Sat, 24 Sep 2022 12:28:05 +0200 Subject: [PATCH] Update replace w/ '.html' filter --- .wiki/filters/html-links.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.wiki/filters/html-links.lua b/.wiki/filters/html-links.lua index 7d95c6c..84d59d6 100644 --- a/.wiki/filters/html-links.lua +++ b/.wiki/filters/html-links.lua @@ -1,5 +1,9 @@ --- https://stackoverflow.com/questions/40993488/convert-markdown-links-to-html-with-pandoc function Link(el) - el.target = string.gsub(el.target, "%.md", ".html") + --Replace markdown extension with html extension + if string.match(el.target, '.md$') then + el.target = string.gsub(el.target, "%.md", "") + --Add html extension + el.target = el.target .. '.html' + end return el end