summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-04-19 00:39:32 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-04-20 21:08:23 +0200
commit0fcd782bd3690867f19420270bcc329325f04424 (patch)
treef74aef28ee2e86251a9188aabb779f339c401bc2 /tests/auto/gui
parentfa83b30ceb1861075e33dc8340d6754daef86b95 (diff)
Markdown writer: don't wrap code block, and detect its end
The end of a code block nested in a list item is now detected; and if the text of the list item continues after the code block, it continues to be indented. Code blocks should never be word-wrapped. Fixes: QTBUG-80603 Change-Id: I4427f8b1d4807d819616f5cb971e2d006170d9be Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md24
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp1
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md b/tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md
new file mode 100644
index 0000000000..c65e01408b
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md
@@ -0,0 +1,24 @@
+- something happens in the debugger like this:
+
+ ```
+ 1 QQuickEventPoint::setGrabberItem qquickevents.cpp 869 0x7ffff7a963f2
+ 2 QQuickItem::grabMouse qquickitem.cpp 7599 0x7ffff7abea29
+ 3 QQuickWindowPrivate::deliverMatchingPointsToItem qquickwindow.cpp 2738 0x7ffff7aea34c
+ 4 QQuickWindowPrivate::deliverPressOrReleaseEvent qquickwindow.cpp 2692 0x7ffff7ae9e57
+ 5 QQuickWindowPrivate::deliverMouseEvent qquickwindow.cpp 1911 0x7ffff7ae561b
+ 6 QQuickWindowPrivate::deliverPointerEvent qquickwindow.cpp 2454 0x7ffff7ae888c
+ 7 QQuickWindowPrivate::handleMouseEvent qquickwindow.cpp 2282 0x7ffff7ae7f1a
+ 8 QQuickWindow::mousePressEvent qquickwindow.cpp 2249 0x7ffff7ae7bf5
+ 9 QQuickView::mousePressEvent qquickview.cpp 626 0x7ffff7bd6bad
+ 10 QWindow::event qwindow.cpp 2258 0x7ffff70b2c54
+ ```
+ and then I want to explain something about it.
+
+- something I tried to fix it:
+
+ ```
+ code goes here, probably c++
+ ```
+- still didn't fix it, expecting a breakthrough any day now
+- some sort of miracle
+- profit!
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
index 31592c7f0f..84cf237ccc 100644
--- a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
+++ b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
@@ -369,6 +369,7 @@ void tst_QTextMarkdownWriter::rewriteDocument_data()
QTest::newRow("list items after headings") << "headingsAndLists.md";
QTest::newRow("word wrap") << "wordWrap.md";
QTest::newRow("links") << "links.md";
+ QTest::newRow("lists and code blocks") << "listsAndCodeBlocks.md";
}
void tst_QTextMarkdownWriter::rewriteDocument()