summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-10-14 07:53:36 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2021-10-16 16:10:49 +0200
commit362e56b520cd5f3efcc7600d558b515a8aec6a79 (patch)
treef3a79dec069a0a5cf3131572bd8d3bf85a2a52dc /src/gui/text
parent848e3855f922e56a156ab8275f45cfb7a361acb5 (diff)
Markdown importer: keep entities in HTML blocks with the HTML
If an entity occurs directly in markdown, we parse and insert it directly; but if it occurs in an HTML block, it has to be added to the HTML accumulator string for deferred parsing when the HTML block ends. Pick-to: 6.2 Fixes: QTBUG-91222 Fixes: QTBUG-94245 Change-Id: I0cf586d68d6751892ca035a98f77cd67950d3bc4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextmarkdownimporter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/text/qtextmarkdownimporter.cpp b/src/gui/text/qtextmarkdownimporter.cpp
index 75b5a324c8..35feb0b3b1 100644
--- a/src/gui/text/qtextmarkdownimporter.cpp
+++ b/src/gui/text/qtextmarkdownimporter.cpp
@@ -490,7 +490,10 @@ int QTextMarkdownImporter::cbText(int textType, const char *text, unsigned size)
break;
#if QT_CONFIG(texthtmlparser)
case MD_TEXT_ENTITY:
- m_cursor->insertHtml(s);
+ if (m_htmlTagDepth)
+ m_htmlAccumulator += s;
+ else
+ m_cursor->insertHtml(s);
s = QString();
break;
#endif