diff options
author | Andy Shaw <qt-info@nokia.com> | 2010-06-21 10:07:20 (GMT) |
---|---|---|
committer | Andy Shaw <qt-info@nokia.com> | 2010-06-21 10:07:20 (GMT) |
commit | 1fb24d6852e34bd58f35172dea4bfd4c41236689 (patch) | |
tree | 56833ba529fdd5b30cbf4da8d1287241c337bf36 /src/gui/text | |
parent | e271abb694c232f746b43544334667f4b3ccc1d0 (diff) | |
download | Qt-1fb24d6852e34bd58f35172dea4bfd4c41236689.zip Qt-1fb24d6852e34bd58f35172dea4bfd4c41236689.tar.gz Qt-1fb24d6852e34bd58f35172dea4bfd4c41236689.tar.bz2 |
Make sure that <br/> is seen as a valid tag in Qt::mightBeRichText()
The W3C online markup validation test verifies that <br/> is indeed
valid XHTML and <br /> is also valid so this ensures that this case is
accounted for.
The existing test was expanded to accout for each of these cases.
Task-number: QTBUG-1786
Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index c7a9756..65e88ab 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -127,6 +127,8 @@ bool Qt::mightBeRichText(const QString& text) tag += text[i]; else if (!tag.isEmpty() && text[i].isSpace()) break; + else if (!tag.isEmpty() && text[i] == QLatin1Char('/') && i + 1 == close) + break; else if (!text[i].isSpace() && (!tag.isEmpty() || text[i] != QLatin1Char('!'))) return false; // that's not a tag } |