« get me outta code hell

add \[[ syntax to skip transforming reference text - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-03-10 10:19:32 -0400
committer(quasar) nebula <towerofnix@gmail.com>2021-03-10 10:19:32 -0400
commit814b1f165c4f6e0623040e2b9b8fb78add1d3930 (patch)
tree7c819df60082f035a0c06b4f24404c8deadbc273
parent590cb87a0eead2db19108e699f5bf652f7bf3431 (diff)
add \[[ syntax to skip transforming reference text
-rwxr-xr-xupd8.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/upd8.js b/upd8.js
index 8dff388e..fefc1874 100755
--- a/upd8.js
+++ b/upd8.js
@@ -835,7 +835,7 @@ const replacerSpec = {
     if (error) process.exit();
 
     const categoryPart = Object.keys(replacerSpec).join('|');
-    transformInline.regexp = new RegExp(String.raw`\[\[((${categoryPart}):)?(.+?)((?<! )#.+?)?(\|(.+?))?\]\]`, 'g');
+    transformInline.regexp = new RegExp(String.raw`(?<!\\)\[\[((${categoryPart}):)?(.+?)((?<! )#.+?)?(\|(.+?))?\]\]`, 'g');
 }
 
 function transformInline(text, {strings, to}) {
@@ -884,7 +884,7 @@ function transformInline(text, {strings, to}) {
             logError`The link ${match} failed to be processed: ${error}`;
             return match;
         }
-    });
+    }).replaceAll(String.raw`\[[`, '[[');
 }
 
 function parseAttributes(string, {to}) {