From 5000a7748333a4e1469cd96d8c1360af2dcf2890 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 8 May 2024 21:50:07 +0100 Subject: [PATCH] bugfix: when escaping # or :, make sure to remove the escape from wikilink name --- src/wikilink-parser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wikilink-parser.js b/src/wikilink-parser.js index 7f39ba5..1ed9a99 100644 --- a/src/wikilink-parser.js +++ b/src/wikilink-parser.js @@ -59,6 +59,8 @@ module.exports = class WikilinkParser { if (nameParts[0].at(-1) !== '/') { name = nameParts[0]; anchor = nameParts[1]; + } else { + name = name.replace('/#', '#'); } } @@ -96,6 +98,8 @@ module.exports = class WikilinkParser { if (parts[0].at(-1) !== '/') { fnName = parts[0]; name = parts[1]; + } else { + name = name.replace('/:', ':'); } }