Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.15.2
-
2118b7eb42 (qt/qtdeclarative/6.4) 7e6db64d43 (qt/qtdeclarative/dev) 2118b7eb42 (qt/tqtc-qtdeclarative/6.4) 7e6db64d43 (qt/tqtc-qtdeclarative/dev)
Description
Issue
// Works: Text is rendered as rich text
TextEdit {
id: te1
textFormat: TextEdit.RichText
Component.onCompleted: te1.insert(te1.length, "<b>Hello</b> World")
}
// Does not work: Text is rendered as literal plaintext
TextEdit {
id: te2
textFormat: TextEdit.MarkdownText
Component.onCompleted: te2.insert(te2.length, "# Hello\n\nWorld")
}
Workaround
Instead of calling insert(), use
te2.text = te2.text + "# Hello\n\nWorld"
Attachments
Issue Links
- relates to
-
QTBUG-81060 Empty line (\n) at the top of QTextEdit and QLabel when using markdown
- Closed
-
QTBUG-76105 add QTextDocumentFragment and clipboard Markdown support
- Open
For Gerrit Dashboard: QTBUG-94462 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
354270,10 | Deal with markdown fragments in TextEdit | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
354523,10 | Add QTextDocFragment::to/fromMarkdown() & QTextCursor::insertMarkdown() | dev | qt/qtbase | Status: MERGED | +2 | 0 |
417080,3 | Deal with markdown fragments in TextEdit | dev | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
421090,2 | Deal with markdown fragments in TextEdit | 6.4 | qt/qtdeclarative | Status: MERGED | +2 | 0 |