From f9c3b0e19337e903a5d2a34f5f32b6f3a5d0d601 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 9 Dec 2023 13:29:49 -0500 Subject: [PATCH] Use table header for triggering markdown detection --- shared/editor/lib/isMarkdown.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared/editor/lib/isMarkdown.ts b/shared/editor/lib/isMarkdown.ts index 680410c88..45bba3c21 100644 --- a/shared/editor/lib/isMarkdown.ts +++ b/shared/editor/lib/isMarkdown.ts @@ -24,5 +24,11 @@ export default function isMarkdown(text: string): boolean { return true; } + // table header-ish + const tables = text.match(/^\|\s?[-]+\s?\|/gm); + if (tables && tables.length > 1) { + return true; + } + return false; }