mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
add regex to replace "unalias" text in removeMarkdown function
This commit is contained in:
parent
1dea156eac
commit
d81cdb3fe7
@ -49,7 +49,10 @@ const removeMarkdown = (
|
|||||||
.replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g, "$2")
|
.replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g, "$2")
|
||||||
.replace(/(`{3,})(.*?)\1/gm, "$2")
|
.replace(/(`{3,})(.*?)\1/gm, "$2")
|
||||||
.replace(/`(.+?)`/g, "$1")
|
.replace(/`(.+?)`/g, "$1")
|
||||||
.replace(/\n{2,}/g, "\n\n");
|
.replace(/\n{2,}/g, "\n\n")
|
||||||
|
// replace alias in links
|
||||||
|
.replace(/\[\[[^\[\]\#\*]+\|([^\[\]]+)\]\]/g, '$1')
|
||||||
|
.replace(/\[([^\[\]]+)\]\([^\(\)]+\)/g, '$1');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
return markdown;
|
return markdown;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user