X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=dd23c5cbfd244e0ec83f1f2ec5fd2d8846243c31;hb=6e85a37d1b7d3501f0fd7cc94fd0fcd4ba0c6cc4;hp=de96b2dfdb437dee697aa2d89d01a1438820bce1;hpb=a540a0285feef171e16fd6225b0e045fc5fc52e4;p=quassel.git diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index de96b2df..dd23c5cb 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -413,7 +413,7 @@ void ContentsChatItem::doLayout(QTextLayout *layout) const { QList ContentsChatItem::findClickables() const { // For matching URLs static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)"); - static QString urlChars("(?:[,.;:]*[\\w\\-~@/?&=+$()!%#*|{}\\[\\]])"); + static QString urlChars("(?:[,.;:]*[\\w\\-~@/?&=+$()!%#*|{}\\[\\]'])"); static QRegExp regExp[] = { // URL @@ -445,7 +445,7 @@ QList ContentsChatItem::findClickables() const { for(int i = 0; i < regExpCount; i++) { if(matches[i] < 0 || matchEnd[i] > str.length()) continue; if(idx >= matchEnd[i]) { - matches[i] = str.indexOf(regExp[i], qMax(matchEnd[i], idx)); + matches[i] = regExp[i].indexIn(str, qMax(matchEnd[i], idx)); if(matches[i] >= 0) matchEnd[i] = matches[i] + regExp[i].cap(1).length(); } if(matches[i] >= 0 && matches[i] < minidx) {