From: Michael Marley Date: Thu, 1 Mar 2018 22:19:47 +0000 (-0500) Subject: Update stripFormatCodes() for additional formatting characters X-Git-Tag: travis-deploy-test~171 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=258df63876c8b2b5f3ff14a6fbae14ea0b713457 Update stripFormatCodes() for additional formatting characters - \x04 for hex color (IRCCloud) - \x11 for monospace (IRCCloud) - \x1e for strikethrough (Textual) This patch does not actually add support for rendering those styles, but at least ensures that highlighting still works correctly if they are used. Closes GH-337. --- diff --git a/src/common/util.cpp b/src/common/util.cpp index a59db8fe..d9b9d2ae 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -73,7 +73,7 @@ bool isChannelName(const QString &str) QString stripFormatCodes(QString message) { - static QRegExp regEx{"\x03(\\d\\d?(,\\d\\d?)?)?|[\x02\x0f\x12\x16\x1d\x1f]"}; + static QRegExp regEx{"\x03(\\d\\d?(,\\d\\d?)?)?|\x04([\\da-fA-F]{6}(,[\\da-fA-F]{6})?)?|[\x02\x0f\x11\x12\x16\x1d\x1e\x1f]"}; return message.remove(regEx); }