diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-01-23 23:55:46 -0700 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-01-24 14:02:33 -0700 |
commit | 3bd4c1b670b8b973e8a782bcaec7078027f6ea36 (patch) | |
tree | b704cc22f8c68188b101935e3c7ffcd77d22afed /tests/auto/gui | |
parent | 212e88889ad02ee7ea0ebbd989c57412cccb59bf (diff) |
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 <axel.spoerl@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md b/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md index 7a0d5388ad..e784879326 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 _____ |