qt5base-lts/tests/auto/gui
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
..
image Fix: confusion in QImage paintEngine creation on shared images 2019-10-24 08:56:21 +02:00
itemmodels Remove usages of deprecated APIs of corelib 2019-07-05 11:25:46 +02:00
kernel Prepare for deprecating the QDesktopWidget 2019-10-15 20:09:29 +02:00
math3d Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
painting Fix: QPainter off-by-one clipping for some non-integer scalings 2019-10-18 06:11:39 +00:00
qopengl unblacklist passing tests 2019-07-08 11:01:42 +00:00
qopenglconfig Deprecate conversion functions between QList and QSet 2019-05-07 14:15:44 +00:00
qvulkan Merge remote-tracking branch 'origin/5.10' into dev 2017-10-17 10:34:24 +02:00
rhi Avoid EGL_BAD_MATCH in tst_qrhi autotest 2019-10-31 14:41:07 +01:00
text Avoid crashing when the end of an empty markdown list is detected 2019-11-05 16:39:13 +02:00
util Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
gui.pro Introduce the Qt graphics abstraction as private QtGui helpers 2019-06-13 10:13:45 +02:00