From aa1760f84bd711cf56159075630fb71d38a4087b Mon Sep 17 00:00:00 2001 From: John Brooks Date: Wed, 23 Oct 2013 20:56:08 -0600 Subject: Allow " in QQuickStyledText QString::toHtmlEscaped generates ". QQuickStyledText should be symmetrical with that function. Change-Id: I67ea0abe446b5fa1edb53258dca58b84af910e28 Reviewed-by: Martin Jones --- src/quick/util/qquickstyledtext.cpp | 2 ++ tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/quick/util/qquickstyledtext.cpp b/src/quick/util/qquickstyledtext.cpp index b8f3ecf7d6..f2b2d2af06 100644 --- a/src/quick/util/qquickstyledtext.cpp +++ b/src/quick/util/qquickstyledtext.cpp @@ -548,6 +548,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("quot")) + textOut += QChar(34); return; } ++entityLength; diff --git a/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp b/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp index 9351919ee8..4e9ceba2a2 100644 --- a/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp +++ b/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp @@ -119,7 +119,7 @@ void tst_qquickstyledtext::textOutput_data() QTest::newRow("font bad 2") << "text" << "" << FormatList() << false; QTest::newRow("extra close") << "text" << "text" << (FormatList() << Format(Format::Bold, 0, 4)) << false; QTest::newRow("extra space") << "text" << "text" << (FormatList() << Format(Format::Bold, 0, 4)) << false; - QTest::newRow("entities") << "<b>this & that</b>" << "this & that" << FormatList() << false; + QTest::newRow("entities") << "<b>"this" & that</b>" << "\"this\" & that" << FormatList() << false; QTest::newRow("newline") << "text
more text" << QLatin1String("text") + QChar(QChar::LineSeparator) + QLatin1String("more text") << FormatList() << false; QTest::newRow("self-closing newline") << "text
more text" << QLatin1String("text") + QChar(QChar::LineSeparator) + QLatin1String("more text") << FormatList() << false; QTest::newRow("paragraph") << "text

more text" << QLatin1String("text") + QChar(QChar::LineSeparator) + QLatin1String("more text") << FormatList() << false; -- cgit v1.2.3