qt5base-lts/tests/auto
Shawn Rutledge 524ab7b535 Avoid crashing when the end of an empty markdown list is detected
The markdown parser generates empty lists in some cases when a character
that can be used as a bullet is found on a line by itself.
cbEnterBlock() and cbLeaveBlock() are called symmetrically in such cases.
QStack::pop() on an empty stack triggers an assert, so push and pop need
to be done symmetrically too.  But it's difficult to actually create the
list as soon as the MD_BLOCK_UL or MD_BLOCK_OL callback occurs, without
breaking the case fixed in 7224d0e427 (and
probably other cases).  That's because QTextCursor::insertList() creates
a list item at the same time as it creates the list itself, and also
inherits block formatting from the previous block.  We now insert empty
lists with empty items whenever the need for that is detected though,
and there's a failsafe to prevent popping in case something still goes
wrong with that logic.  We aren't strict about reproducing the original
markdown when regenerating it via toMarkdown(), but it's getting closer.

Fixes: QTBUG-78870
Change-Id: Ided194ce7aec2710c60dbac42761ee4169ed9b78
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2019-11-05 16:39:13 +02:00
..
bic/data Add binary compatibility files for Qt5.13.0 for QtBase 2019-08-15 04:19:39 +00:00
cmake CMake: Add support for auto-importing plugins in CMake 2019-08-12 18:23:58 +02:00
concurrent Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of it 2019-07-12 14:26:30 +02:00
corelib Make tst_QNumeric more systematic about checking float as well as double 2019-10-29 16:46:54 +01:00
dbus unblacklist passing tests 2019-07-08 11:01:42 +00:00
gui Avoid crashing when the end of an empty markdown list is detected 2019-11-05 16:39:13 +02:00
guiapplauncher
installed_cmake
network Merge remote-tracking branch 'origin/5.13' into 5.14 2019-10-24 10:23:44 +02:00
opengl Remove dead code from Qt 4 times 2019-08-20 22:27:46 +00:00
other Merge remote-tracking branch 'origin/5.13' into 5.14 2019-10-28 10:50:03 +01:00
printsupport Remove the remaining usages of deprecated APIs of qtbase 2019-08-01 06:48:27 +02:00
shared Make tst_qwidget pass on High-DPI screens (Windows) 2019-06-03 10:41:08 +02:00
sql Merge remote-tracking branch 'origin/5.13' into 5.14 2019-10-24 10:23:44 +02:00
testlib Fix crash when using signaldumper and sender is deleted 2019-09-23 08:27:18 +00:00
tools Make conflicting targets check less strict 2019-10-03 20:28:03 +02:00
widgets Merge remote-tracking branch 'origin/5.13' into 5.14 2019-10-28 10:50:03 +01:00
xml Convert uses of QTime as a timer to QElapsedTimer 2019-06-14 10:42:33 +02:00
auto.pro
network-settings.h test: migrate QNetworkReply test to QRegularExpression 2019-06-10 16:49:19 +02:00