From f7a3c2b291916dccc1f175dcd621e6ac89a1ae62 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 21 Jul 2024 00:59:44 +0200 Subject: [PATCH] remove backslashes from escaped text that is exported --- src/background-script/html-to-markdown.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/background-script/html-to-markdown.ts b/src/background-script/html-to-markdown.ts index 4b64607539..6bdc623f54 100644 --- a/src/background-script/html-to-markdown.ts +++ b/src/background-script/html-to-markdown.ts @@ -22,9 +22,8 @@ export function htmlToMarkdown( let markdown = turndownService.turndown(doc) - // Replace escaped double brackets with unescaped double brackets - markdown = markdown.replace(/\\\[\\\[/g, '[[') - markdown = markdown.replace(/\\\]\\\]/g, ']]') + // Replace escaped backslashes with nothing + markdown = markdown.replace(/\\(.)/g, '$1') return markdown }