Review fixes

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-03 17:11:48 +04:00
parent b9d7beb22c
commit 9ebb86ab37
2 changed files with 3 additions and 12 deletions

View File

@@ -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")
) {

View File

@@ -39,7 +39,7 @@ export function safeLinkHref(href: string): string {
return "#";
}
} catch {
return href;
return "#";
}
}