Summary: | color in channel name has strange effects | ||
---|---|---|---|
Product: | [Applications] konversation | Reporter: | Wouter Coekaerts <wouter> |
Component: | general | Assignee: | Konversation Developers <konversation-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Wouter Coekaerts
2005-01-18 16:28:22 UTC
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 |