From: Adam Dullage Date: Wed, 21 May 2025 11:41:21 +0000 (+0100) Subject: #310 Update wikilink regex to ignore empty brackets X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=cf355dd8586cc484cde23e6a35c8fcf5dca331ac;p=flatnotes.git #310 Update wikilink regex to ignore empty brackets --- diff --git a/client/components/toastui/extendedAutolinks.js b/client/components/toastui/extendedAutolinks.js index 7e2c73f..ef2fd51 100644 --- a/client/components/toastui/extendedAutolinks.js +++ b/client/components/toastui/extendedAutolinks.js @@ -76,7 +76,7 @@ export function parseUrlLink(source) { // end of raw toast-ui source function parseWikiLink(source) { - const matched = source.matchAll(/\[\[(.*?)\]\]/g); + const matched = source.matchAll(/\[\[\s*(\S(?:[^\[\]]*?\S)?)\s*\]\]/g); if (matched) { return Array.from(matched).map((match) => { const text = match[1];