summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qtextmarkdownwriter
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-05-20 23:49:04 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2022-06-11 14:18:35 +0000
commiteee9d252028c4b3b743c77a406cd6939eda3962f (patch)
treebadceeddc8a36c645faa0e6e9444dae764a0400e /tests/auto/gui/text/qtextmarkdownwriter
parent88f5955cb750f2fe3468fe13fef4a11b887315c1 (diff)
Use CSS classes on html list items for checkbox support
If we replace the bullet character with a UC checkbox character, it looks ok in a browser, and the HTML parser can recover the BlockMarker attribute from the css class. [ChangeLog][QtGui][Text] Checkbox list items can now be read and written in both HTML and Markdown, including conversions. Task-number: QTBUG-103714 Change-Id: Ic6b74512075cd4ac16d6f80fdf55b221447491a9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/gui/text/qtextmarkdownwriter')
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
index b258869dfd..2b6b1ecca5 100644
--- a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
+++ b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
@@ -502,6 +502,9 @@ void tst_QTextMarkdownWriter::fromHtml_data()
QTest::newRow("preformats with embedded backticks") <<
"<pre>none `one` ``two``</pre>plain<pre>```three``` ````four````</pre>plain" <<
"```\nnone `one` ``two``\n\n```\nplain\n\n```\n```three``` ````four````\n\n```\nplain\n\n";
+ QTest::newRow("list items with and without checkboxes") <<
+ "<ul><li>bullet</li><li class=\"unchecked\">unchecked item</li><li class=\"checked\">checked item</li></ul>" <<
+ "- bullet\n- [ ] unchecked item\n- [x] checked item\n";
}
void tst_QTextMarkdownWriter::fromHtml()