aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickstyledtext
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2015-05-27 10:52:59 +0200
committerKai Uwe Broulik <kde@privat.broulik.de>2015-07-03 14:47:14 +0000
commit8b205fd05dcdc4a0e7ec6b25429f691a0a9099fe (patch)
treef3f5f3526fa03e0f475535215ebb7502a44c3fb2 /tests/auto/quick/qquickstyledtext
parenta3f686cf7cc14ff481b972b1170a7ff76d0e0fd0 (diff)
Improve support for HTML entities in StyledText
This adds support for the non-breaking space character (&nbsp;) and properly handling entities that do not end with a semicolon, such as a stray ampersand in a text. Change-Id: I2f157c9aa651b27511809d5a47ac07660949a290 Task-number: QTBUG-44869 Task-number: QTBUG-31816 Task-number: QTBUG-33368 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquickstyledtext')
-rw-r--r--tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp b/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
index b76218edb9..816440b191 100644
--- a/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
+++ b/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
@@ -153,6 +153,8 @@ void tst_qquickstyledtext::textOutput_data()
QTest::newRow("space trailing bold") << "this is <b>bold </b>" << "this is bold " << (FormatList() << Format(Format::Bold, 8, 5)) << false;
QTest::newRow("img") << "a<img src=\"blah.png\"/>b" << "a b" << FormatList() << false;
QTest::newRow("tag mix") << "<f6>ds<b></img><pro>gfh</b><w><w>ghj</stron><ql><sl><pl>dfg</j6><img><bol><r><prp>dfg<bkj></b><up><string>ewrq</al><bl>jklhj<zl>" << "dsgfhghjdfgdfgewrqjklhj" << (FormatList() << Format(Format::Bold, 2, 3)) << false;
+ QTest::newRow("named html entities") << "&gt; &lt; &amp; &quot; &nbsp;" << QLatin1String("> < & \" ") + QChar(QChar::Nbsp) << FormatList() << false;
+ QTest::newRow("invalid html entities") << "a &hello & a &goodbye;" << "a &hello & a " << FormatList() << false;
}
void tst_qquickstyledtext::textOutput()