regexp syntax
parent
8e996071d1
commit
805bcb92a2
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue