From 74d2688aa329f0a41c2a92034c3454ed9299e71a Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 14 Sep 2022 16:21:42 +0200 Subject: Fix to prefer flow over definitions, setext headings An undocumented part of CommonMark is how to deal with things in definition labels or definition titles (which both can span multiple lines). Can flow (or containers?) interrupt them? They can according to the `cmark` reference parser, so this was implemented here. This adds a new `Content` content type, which houses zero or more definitions, and then zero-or-one paragraphs. Content can be followed by a setext heading underline, which either turns into a setext heading when the content ends in a paragraph, or turns into the start of the following paragraph when it is followed by content that starts with a paragraph, or turns into a stray paragraph. --- tests/gfm_table.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/gfm_table.rs') diff --git a/tests/gfm_table.rs b/tests/gfm_table.rs index 619bf2a..b7f884a 100644 --- a/tests/gfm_table.rs +++ b/tests/gfm_table.rs @@ -337,6 +337,12 @@ fn gfm_table() -> Result<(), String> { "should not support a lazy delimiter row if the head row and a further body row are in a container" ); + assert_eq!( + micromark_with_options("[\na\n:-\n]: b", &gfm)?, + "

[

\n\n\n\n\n\n\n\n\n\n\n\n
a
]: b
", + "should prefer GFM tables over definitions" + ); + assert_eq!( micromark_with_options( r###"# Align -- cgit