From adc4f2b544778a89833bcd4d8575f326533e9e0e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 2 May 2024 21:19:44 -0400 Subject: [PATCH] fix: Enable import of tables from HTML that contain headings or lists --- server/utils/turndown/tables.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/server/utils/turndown/tables.ts b/server/utils/turndown/tables.ts index 4290418fc..7a38149d0 100644 --- a/server/utils/turndown/tables.ts +++ b/server/utils/turndown/tables.ts @@ -234,19 +234,7 @@ const nodeContains = (node: HTMLElement, types: string | string[]) => { }; const tableShouldBeHtml = (tableNode: HTMLElement) => - nodeContains(tableNode, "code") || - nodeContains(tableNode, [ - "UL", - "OL", - "H1", - "H2", - "H3", - "H4", - "H5", - "H6", - "HR", - "BLOCKQUOTE", - ]); + nodeContains(tableNode, ["code", "table"]); // Various conditions under which a table should be skipped - i.e. each cell // will be rendered one after the other as if they were paragraphs.