From d1c6f7e5a2e0ee6c50bbf0668e44200bd8469a09 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 14 Oct 2019 17:59:16 +0200 Subject: QTextMarkdownWriter: preserve empty lists You can save a "skeletal" document with list items to fill in later, the same as you can do in HTML or ODF format. Reading them back via QTextDocument::fromMarkdown() isn't always perfect though. Fixes: QTBUG-79217 Change-Id: Iacdb3e6792250ebdead05f314c9e3d00546eeb9f Reviewed-by: Shawn Rutledge --- src/gui/text/qtextmarkdownwriter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qtextmarkdownwriter.cpp b/src/gui/text/qtextmarkdownwriter.cpp index 764c64aead..c9a63920c3 100644 --- a/src/gui/text/qtextmarkdownwriter.cpp +++ b/src/gui/text/qtextmarkdownwriter.cpp @@ -173,7 +173,8 @@ void QTextMarkdownWriter::writeFrame(const QTextFrame *frame) if (lastWasList) m_stream << Newline; } - int endingCol = writeBlock(block, !table, table && tableRow == 0, nextIsDifferent); + int endingCol = writeBlock(block, !table, table && tableRow == 0, + nextIsDifferent && !block.textList()); m_doubleNewlineWritten = false; if (table) { QTextTableCell cell = table->cellAt(block.position()); -- cgit v1.2.3