htmlToMarkdown: remove escapes when comparing content and link

This commit is contained in:
Cynthia Foxwell 2025-04-05 12:53:35 -06:00
parent 039e5ed7bb
commit 4d8d36eaf6
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -58,7 +58,10 @@ function whenYouWalking(tree, images = true, embed = true) {
if (link == null || !link.startsWith("http")) {
str += content;
} else if (content == link || link.replace(/^https?:\/\//, "") == content) {
} else if (
content.replaceAll("\\", "") == link ||
link.replace(/^https?:\/\//, "") == content.replaceAll("\\", "")
) {
str += embed ? link : `<${link}>`;
} else {
str += `[${content.replaceAll("\\", "")}](${embed ? "" : "<"}${link}${embed ? "" : ">"}${