From a2f4344f5c82b709766b28ef349e4400ae118ef5 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sat, 5 Apr 2025 10:42:18 -0600 Subject: [PATCH] htmlToMarkdown: unescape masked links --- src/util/html.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/html.js b/src/util/html.js index c54c777..5b928b4 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -61,7 +61,9 @@ function whenYouWalking(tree, images = true, embed = true) { } else if (content == link || link.replace(/^https?:\/\//, "") == content) { str += embed ? link : `<${link}>`; } else { - str += `[${content}](${embed ? "" : "<"}${link}${embed ? "" : ">"}${alt != null ? ` "${alt}"` : ""})`; + str += `[${content.replaceAll("\\", "")}](${embed ? "" : "<"}${link}${embed ? "" : ">"}${ + alt != null ? ` "${alt}"` : "" + })`; } } else if (elem.b) { str += `**${whenYouWalking(elem.b, images, embed)}**`;