qt5base-lts/tests/auto/gui
Shawn Rutledge 04a60bb033 Convert <pre> to Markdown ``` and vice-versa with nonBreakableLines
The HTML parser calls QTextBlockFormat::setNonBreakableLines(true) when
it sees a <pre> tag; so for symmetry, the markdown reader now does the
same when it sees a fenced code block, and the markdown writer honors
the nonBreakableLines property by writing a fenced code block. This
preserves the meaning better when reading HTML and writing markdown or
vice-versa, without modifying HTML reading or writing code.

Added a test tst_QTextMarkdownImporter::fencedCodeBlocks() which
unfortunately also highlights a known bug in the markdown reader: each
fenced code block ends with an extra empty block. That can be fixed
separately.

tst_QTextMarkdownWriter::fromHtml(preformats with embedded backticks)
that we re-enabled in 1abaf9d5d6 was not a
very useful test: ``` with a space and some words but no newline is not
a fence: it's just like a `monospace` span. We have had trouble with
those in CI because of missing monospace fonts, or inconsistency when
a supposedly mono font's QFontInfo::fixedPitch() returns false.
So just test proper <pre>/fence conversion for now.

Pick-to: 6.3
Fixes: QTBUG-100515
Fixes: QTBUG-100981
Task-number: QTBUG-101031
Change-Id: I88f0ede0810d8a9480b30eb0cd780e1af67cc5f2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-05-19 14:43:39 +02:00
..
image Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
itemmodels Use QAbstractItemModelTester or QFileSystemModel 2022-05-18 12:58:06 +02:00
kernel Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
math3d Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
painting Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
platform Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qopengl Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qopenglconfig Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qvulkan Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
rhi Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
text Convert <pre> to Markdown ``` and vice-versa with nonBreakableLines 2022-05-19 14:43:39 +02:00
util Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
CMakeLists.txt Move QtX11Extras into QtGui as private API 2021-05-10 21:19:46 +00:00