From fd8e386f7f259070899553e55c99a2a49a378480 Mon Sep 17 00:00:00 2001
From: Theo Browne More rows
two
", + "oneone
two
", + ])("keeps a table row intact when a cell contains block HTML: %s", async (cell) => { + const native = await parseMarkdown( + markdownForNativeRendering( + `| A | B |\n| - | - |\n| ${cell} | x |`, + ENRICHED_INLINE_FILE_LINK_REGEX, + ), + ); + const text = (node: { content?: string; children?: unknown[] }): string => + (node.content ?? "") + + (node.children ?? []).map((child) => text(child as typeof node)).join(""); + expect(native.children).toHaveLength(1); + expect(native.children?.[0]?.children?.[1]?.children?.[0]?.children?.map(text)).toEqual([ + expect.stringMatching(/one\s*two/), + "x", + ]); + }); + it("keeps a table row intact when an anchor href contains a pipe", () => { const document = parseMarkdownDocument( "| Preview | Logs |\n| - | - |\n| Open | done |", From bd8ea129904165b7ea511e59fdaf857ac6d86307 Mon Sep 17 00:00:00 2001 From: Julius Marminge