From 59f807cb7cbf26da09ee654bda0f74addef5b6f4 Mon Sep 17 00:00:00 2001 From: Yanlong Wang Date: Thu, 9 May 2024 11:32:26 +0800 Subject: [PATCH] fix: tidyMarkdown --- backend/functions/src/utils/markdown.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/backend/functions/src/utils/markdown.ts b/backend/functions/src/utils/markdown.ts index 673ced9..0feaa9d 100644 --- a/backend/functions/src/utils/markdown.ts +++ b/backend/functions/src/utils/markdown.ts @@ -1,9 +1,6 @@ export function tidyMarkdown(markdown: string): string { const lines = markdown.split('\n'); const processedLines = lines.map((line) => { - // Remove leading spaces from each line - line = line.replace(/^[ \t]+/, ''); - // Handle complex broken links with text and optional images line = line.replace(/\[\s*([^\]\n!]*?)\s*(?:!\[([^\]]*)\]\((.*?)\))?\s*\]\s*\(\s*([^)\n]+)\s*\)/g, (match, text, alt, imgUrl, linkUrl) => { text = text.replace(/\s+/g, ' ').trim();