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. Change-Id: I5a4bf8720d994616274eb8534b4d7085399130fc Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 3bd4c1b670b8b973e8a782bcaec7078027f6ea36) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 2f5fe6a9a10f967622f9831e4bd06d633f105e20) (cherry picked from commit 9aedd9413b1543699d24f80a0ebc91e052bf037a)
This commit is contained in:
parent
1e31dad8a2
commit
3fa20b8e55
@ -11,6 +11,7 @@ stars
|
||||
stars with tabs between
|
||||
***
|
||||
stars with whitespace after
|
||||
|
||||
---
|
||||
hyphens with whitespace after
|
||||
_____
|
||||
|
Loading…
x
Reference in New Issue
Block a user