From 5a032a638994861fa0a2902729b128819e75ebdf Mon Sep 17 00:00:00 2001 From: Olaf Sulich Date: Mon, 13 Jan 2025 12:58:58 +0100 Subject: [PATCH] refactor(MarkdownUtil): enhance table pattern regex to allow variable column lengths --- src/script/util/MarkdownUtil.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/util/MarkdownUtil.ts b/src/script/util/MarkdownUtil.ts index c66aa7b7d48..9e11b5af88b 100644 --- a/src/script/util/MarkdownUtil.ts +++ b/src/script/util/MarkdownUtil.ts @@ -31,7 +31,7 @@ const CODE_BLOCK_PATTERN = /```[\s\S]*?```/; const INLINE_CODE_PATTERN = /`[^`]+`/; const HORIZONTAL_RULE_PATTERN = /^(?:[-*_]){3,}\s*$/m; const TABLE_PATTERN_1 = /^\|[^|]+\|.*$/gm; -const TABLE_PATTERN_2 = /^\|[-:|]+(?:\|[-:|]+)*\|$/gm; +const TABLE_PATTERN_2 = /^\|[-:|]+(?:\|[-:|]{1,10})*\|$/gm; const STRIKETHROUGH_PATTERN = /~~[^~]+~~/; const UNORDERED_LIST_DETECT_PATTERN = /^[-*+]\s.*/m;