diff options
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 |
commit | 814b1f165c4f6e0623040e2b9b8fb78add1d3930 (patch) | |
tree | 7c819df60082f035a0c06b4f24404c8deadbc273 | |
parent | 590cb87a0eead2db19108e699f5bf652f7bf3431 (diff) |
add \[[ syntax to skip transforming reference text
-rwxr-xr-x | upd8.js | 4 |
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}) { |