From 9ebb86ab37e1f0f86f8e2cf38896ac7c3077d655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Fri, 3 Apr 2026 17:11:48 +0400 Subject: [PATCH] Review fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- packages/prosemirror/src/hasMarkdown.ts | 13 ++----------- packages/prosemirror/src/htmlBlock.ts | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/prosemirror/src/hasMarkdown.ts b/packages/prosemirror/src/hasMarkdown.ts index 862f80601..c4a4e23ea 100644 --- a/packages/prosemirror/src/hasMarkdown.ts +++ b/packages/prosemirror/src/hasMarkdown.ts @@ -34,22 +34,13 @@ function isTableSeparatorLine(line: string): boolean { return true; } -function isWordChar(c: number): boolean { - return ( - (c >= 48 && c <= 57) || - (c >= 65 && c <= 90) || - (c >= 97 && c <= 122) || - c === 95 - ); -} - function hasMarkdownLine(line: string): boolean { if (line.length === 0) return false; const ch = line[0]; if (ch === "`" && line.startsWith("```")) { for (let i = 3; i < line.length; i++) { - if (!isWordChar(line.charCodeAt(i))) return false; + if (line[i] === "`") return false; } return true; } @@ -77,7 +68,7 @@ function hasMarkdownLine(line: string): boolean { while (i < line.length && line[i] >= "0" && line[i] <= "9") i++; if ( i < line.length && - line[i] === "." && + (line[i] === "." || line[i] === ")") && i + 1 < line.length && (line[i + 1] === " " || line[i + 1] === "\t") ) { diff --git a/packages/prosemirror/src/htmlBlock.ts b/packages/prosemirror/src/htmlBlock.ts index 886868ba9..9a137d6c5 100644 --- a/packages/prosemirror/src/htmlBlock.ts +++ b/packages/prosemirror/src/htmlBlock.ts @@ -39,7 +39,7 @@ export function safeLinkHref(href: string): string { return "#"; } } catch { - return href; + return "#"; } }