diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-09-02 12:00:33 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-09-02 12:00:33 +0200 |
commit | 78b013b2ac92ccff5589c5abd18b90a5eec28900 (patch) | |
tree | 9f0b3d467803613f40a1a6d428068e1b9de07c61 /src/urlbar | |
parent | rekonq 0.5.85 (diff) | |
download | rekonq-78b013b2ac92ccff5589c5abd18b90a5eec28900.tar.xz |
This commit hopes to definitely fix troubles with HTML encodings.
It needs manual testing (waiting for some automatic ones..)
I tested it with the following strings:
plan b
i
b
kde
<i>
<b>
a & b
fix & fit
and it seems working well. Let me know if it is really true :)
CCBUG: 249736
CCMAIL: pierre.rossi@nokia.com
Diffstat (limited to 'src/urlbar')
-rw-r--r-- | src/urlbar/listitem.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index 0df080ae..99b2423d 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -212,12 +212,11 @@ TextLabel::TextLabel(const QString &text, const QString &textToPointOut, QWidget const bool wasItalic = t.startsWith("<i>"); if (wasItalic) t.remove(QRegExp("<[/ib]*>")); + t = Qt::escape(t); - QStringList words = textToPointOut.split(" "); - foreach (const QString &wordToPointOut, words) { - if (!wordToPointOut.isEmpty()) - t.replace(QRegExp('(' + wordToPointOut + ')', Qt::CaseInsensitive), "<b>\\1</b>"); - } + QString ss = Qt::escape(textToPointOut); + t.replace(QRegExp('(' + ss + ')', Qt::CaseInsensitive), "<b>\\1</b>"); + if (wasItalic) t = QL1S("<i>") + t + QL1S("</i>"); @@ -318,7 +317,7 @@ QString SearchListItem::text() QString SearchListItem::searchItemTitle(QString engine, QString text) { - return QString(i18nc("%1=search engine, e.g. Google, Wikipedia %2=text to search for", "Search %1 for %2", engine, Qt::escape(text))); + return QString(i18nc("%1=search engine, e.g. Google, Wikipedia %2=text to search for", "Search %1 for %2", engine, text)); } |