mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader.git
synced 2025-08-19 22:39:11 +08:00
fix: tidyMarkdown
This commit is contained in:
parent
4bee36ed4a
commit
6b6774f43b
@ -2,7 +2,7 @@ export function tidyMarkdown(markdown: string): string {
|
||||
const lines = markdown.split('\n');
|
||||
const processedLines = lines.map((line) => {
|
||||
// Remove leading spaces from each line
|
||||
line = line.trimStart();
|
||||
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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user