From b8d2823d2b37390f9f2198b8b787b473d9ab400f Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 8 Aug 2021 21:06:43 +0200 Subject: [PATCH] feat: Deal correctly in markdown with links that contain parenthesis. --- src/utils/toMarkdown.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/toMarkdown.js b/src/utils/toMarkdown.js index 9c3a696..3b2cf51 100644 --- a/src/utils/toMarkdown.js +++ b/src/utils/toMarkdown.js @@ -4,7 +4,9 @@ import textVersion from "textversionjs" /* Definitions */ var styleConfig = { linkProcess: function(href, linkText){ - return `[${linkText}](${href})`; + let newHref = href ? href.replace(/\(/g, "%28").replace(/\)/g, "%29") : "" + // Deal corretly in markdown with links that contain parenthesis + return `[${linkText}](${newHref})`; }, }