Open matthewhughes934 opened 8 months ago
Here's a quick hack copying some behaviour from how titles behave (which also can't be broken)
diff --git a/extensions/table.c b/extensions/table.c
index e8359f2..61ee353 100644
--- a/extensions/table.c
+++ b/extensions/table.c
@@ -567,6 +567,7 @@ static void commonmark_render(cmark_syntax_extension *extension,
if (node->type == CMARK_NODE_TABLE) {
renderer->blankline(renderer);
} else if (node->type == CMARK_NODE_TABLE_ROW) {
+ renderer->no_linebreaks = entering;
if (entering) {
renderer->cr(renderer);
renderer->out(renderer, node, "|", false, LITERAL);
At a glance I didn't see any tests covering conversion to commonmark though, so not sure how valid this is
Given the content:
Rendering with a width less than that of one of the rows of the table gives:
Which is not compatible with the original content since it will render an extra row:
From what I can tell reading the spec https://github.github.com/gfm/#tables-extension- there's no support for breaking table rows over several lines, so I suppose the commonmark render should never try to break these lines, regardless of width?