regexp syntax

main
Lee Hanken 2022-04-02 14:03:41 +01:00
parent 8e996071d1
commit 805bcb92a2
1 changed files with 2 additions and 6 deletions

View File

@ -82,12 +82,8 @@ module.exports = {
// removes inline links and refs
if (!links) {
data = data.replaceAll(/([^!])\[\[?([^\]]+\]?)\]\([^\)]+\)/g,
(match, prefix, title) => prefix+'*'+title+'*'
);
data = data.replaceAll(/\*\\\[([^\\]+)\\\]\*/g,
(match, ref) => '['+ref+']'
);
data = data.replaceAll(/([^!])\[\[?([^\]]+\]?)\]\([^\)]+\)/g, '$1*$2*');
data = data.replaceAll(/\*\\\[([^\\]+)\\\]\*/g, '[$1]');
}
return data;