From abc097a32e13fe8b0a5b2f08430cc580a24f3b06 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 23 Jan 2024 23:55:46 -0700 Subject: [PATCH] Avoid detection of heading in tst_QTextMarkdownImporter::thematicBreaks In md4c 0.4.8, three or more hyphens immediately after text were seen as a thematic break: some text --- But in 0.5.1 it makes the text into an H2 heading (even though this style of heading would normally have the text fully "underlined" with hyphens). The CommonMark spec 0.30 says If a line of dashes that meets the above conditions for being a thematic break could also be interpreted as the underline of a setext heading, the interpretation as a setext heading takes precedence. Thus, for example, this is a setext heading, not a paragraph followed by a thematic break: https://spec.commonmark.org/0.30/#example-59 So the new behavior seems more correct. But rather than testing so deeply, just disambiguate by adding a newline, since Qt may be expected to work with various versions of md4c, and such minor behavior differences are not expected to come up often in practice. QTextMarkdownWriter already adds a newline when writing such markdown. Pick-to: 6.2 6.5 6.6 6.6.2 6.7 Change-Id: I5a4bf8720d994616274eb8534b4d7085399130fc Reviewed-by: Axel Spoerl (cherry picked from commit 3bd4c1b670b8b973e8a782bcaec7078027f6ea36) --- tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md b/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md index 7a0d5388adf..e784879326f 100644 --- a/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md +++ b/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md @@ -11,6 +11,7 @@ stars stars with tabs between *** stars with whitespace after + --- hyphens with whitespace after _____