qt5base-lts/tests/auto/gui/text/qtextmarkdownwriter
Shawn Rutledge 7224d0e427 QTextMarkdownImporter: don't keep heading level on following list item
When reading a document like

 # heading
 - list item

and then re-writing it, it turned into

 # heading
 - # list item

because QTextCursor::insertList() simply calls QTextCursor::insertBlock(), thus
inheriting block format from the previous block, without an opportunity to
explicitly define the block format.  So be more consistent: use
QTextMarkdownImporter::insertBlock() for blocks inside list items too.  Now it
fully defines blockFormat first, then inserts the block, and then adds it to
the current list only when the "paragraph" is actually the list item's text
(but not when it's a continuation paragraph).  Also, be prepared for applying
and removing block markers to arbitrary blocks, just in case (they might be
useful for block quotes, for example).

Change-Id: I391820af9b65e75abce12abab45d2477c49c86ac
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-24 15:37:05 +02:00
..
data QTextMarkdownImporter: don't keep heading level on following list item 2019-05-24 15:37:05 +02:00
BLACKLIST Add QTextMarkdownWriter, QTextEdit::markdown property etc. 2019-05-01 14:31:27 +00:00
qtextmarkdownwriter.pro Markdown: blockquotes, code blocks, and generalized nesting 2019-05-08 20:28:53 +00:00
tst_qtextmarkdownwriter.cpp QTextMarkdownImporter: don't keep heading level on following list item 2019-05-24 15:37:05 +02:00