From eee9d252028c4b3b743c77a406cd6939eda3962f Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 20 May 2022 23:49:04 +0200 Subject: 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 Reviewed-by: Allan Sandfeld Jensen --- tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp') 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") << "
none `one` ``two``
plain
```three``` ````four````
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") << + "
  • bullet
  • unchecked item
  • checked item
" << + "- bullet\n- [ ] unchecked item\n- [x] checked item\n"; } void tst_QTextMarkdownWriter::fromHtml() -- cgit v1.2.3