simplify references

main
Lee Hanken 2022-04-02 13:55:35 +01:00
parent a5a144a92c
commit 8e996071d1
1 changed files with 4 additions and 1 deletions

View File

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