diff options
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
| -rw-r--r-- | src/gui/text/qtextdocument.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 71511257f51..463026ed238 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2372,6 +2372,8 @@ QString QTextHtmlExporter::toHtml(ExportMode mode) html += "<style type=\"text/css\">\n"_L1; html += "p, li { white-space: pre-wrap; }\n"_L1; html += "hr { height: 1px; border-width: 0; }\n"_L1; + html += "li.unchecked::marker { content: \"\\2610\"; }\n"_L1; + html += "li.checked::marker { content: \"\\2612\"; }\n"_L1; html += "</style>"_L1; html += "</head><body"_L1; @@ -3038,7 +3040,7 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block) html += " style=\""_L1; html += styleString; - html += "\">"_L1; + html += "\">\n"_L1; } html += "<li"_L1; @@ -3051,6 +3053,18 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block) defaultCharFormat.merge(block.charFormat()); } + if (block.blockFormat().hasProperty(QTextFormat::BlockMarker)) { + switch (block.blockFormat().marker()) { + case QTextBlockFormat::MarkerType::Checked: + html += " class=\"checked\""_L1; + break; + case QTextBlockFormat::MarkerType::Unchecked: + html += " class=\"unchecked\""_L1; + break; + case QTextBlockFormat::MarkerType::NoMarker: + break; + } + } } const QTextBlockFormat blockFormat = block.blockFormat(); |
