Version: 0.16 (using KDE KDE 3.3.1) Installed from: Debian testing/unstable Packages OS: Linux A color code in a channel name that's being said has strange effects. For example, type: #%C and you'll get # color="#000000"> which is a link to #<font
CVS commit by cartman: Escape colors in #channel. Damned mirc lamers! Regexp by JohnFlux(thanks!) edited slightly by me. BUG:97350 M +8 -1 common.cpp 1.16 --- kdeextragear-2/konversation/konversation/common.cpp #1.15:1.16 @@ -50,4 +50,11 @@ QString tagURLs(const QString& text, con channelPattern.setCaseSensitive(false); + // See http://bugs.kde.org/show_bug.cgi?id=97350 + QRegExp colorRegex=QRegExp("#<font color=\"#\\S+\">(.*)</font>"); + colorRegex.setMinimal(true); + colorRegex.setCaseSensitive(false); + colorRegex.search(filteredLine); + filteredLine.replace(colorRegex,"#"+colorRegex.cap(1)); + while(channelPattern.search(filteredLine, pos) != -1) {
commit 33b55cd4ac0d70bf4c40c5558e2d69271ba26b5f Author: İsmail Dönmez <ismail@kde.org> Date: Tue Jan 18 18:12:59 2005 +0000 Escape colors in #channel. Damned mirc lamers! Regexp by JohnFlux(thanks!) edited slightly by me. BUG:97350 svn path=/trunk/kdeextragear-2/konversation/; revision=379849 diff --git a/konversation/common.cpp b/konversation/common.cpp index 3dcda73..15ac500 100644 --- a/konversation/common.cpp +++ b/konversation/common.cpp @@ -48,7 +48,14 @@ QString tagURLs(const QString& text, const QString& fromNick) ); channelPattern.setCaseSensitive(false); - + + // See http://bugs.kde.org/show_bug.cgi?id=97350 + QRegExp colorRegex=QRegExp("#<font color=\"#\\S+\">(.*)</font>"); + colorRegex.setMinimal(true); + colorRegex.setCaseSensitive(false); + colorRegex.search(filteredLine); + filteredLine.replace(colorRegex,"#"+colorRegex.cap(1)); + while(channelPattern.search(filteredLine, pos) != -1) { // Remember where we found the url