Support ' in styled text and document it
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sat, 18 Dec 2021 12:47:05 +0000 (12:47 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Sat, 18 Dec 2021 12:47:05 +0000 (12:47 +0000)
Origin: https://invent.kde.org/qt/qt/qtdeclarative/-/merge_requests/3/diffs
Forwarded: not-needed
Applied-Upstream: https://invent.kde.org/qt/qt/qtdeclarative/-/commit/0dda47d9f1a22567ad8f1266be2f0cd8a9226c7f

This ensures that some translations really look ok.

Gbp-Pq: Name support_apos_in_styled_text.patch

src/quick/items/qquicktext.cpp
src/quick/util/qquickstyledtext.cpp

index 90469ee82b67d1ee60c2645770d594d3ec0e0783..f94e1c8ed5d0f350cb9989133c87c99c1bc07fde 100644 (file)
@@ -2166,7 +2166,7 @@ void QQuickText::resetMaximumLineCount()
     <img src="" align="top,middle,bottom" width="" height=""> - inline images
     <ol type="">, <ul type=""> and <li> - ordered and unordered lists
     <pre></pre> - preformatted
-    &gt; &lt; &amp;
+    &gt; &lt; &amp; &quot; &nbsp; &apos;
     \endcode
 
     \c Text.StyledText parser is strict, requiring tags to be correctly nested.
index 660852ba83fe4387040e22cfb8c4ec9ccf3a8bbe..e81240db7884f5d88ad590168f77b0f557767ba0 100644 (file)
@@ -562,6 +562,8 @@ void QQuickStyledTextPrivate::parseEntity(const QChar *&ch, const QString &textI
                 textOut += QChar(60);
             else if (entity == QLatin1String("amp"))
                 textOut += QChar(38);
+            else if (entity == QLatin1String("apos"))
+                textOut += QChar(39);
             else if (entity == QLatin1String("quot"))
                 textOut += QChar(34);
             else if (entity == QLatin1String("nbsp"))