From 127e9f3ccf9ac66bc0b0a183d559f3cc950cfc38 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 8 Aug 2004 02:07:11 +0000 Subject: [PATCH] Fixed a bug in stripFormatting. --- src/ircutils.py | 2 +- test/test_ircutils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ircutils.py b/src/ircutils.py index 51958b75e..d987b7cfe 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -317,8 +317,8 @@ def stripUnderline(s): def stripFormatting(s): """Returns the string s, with all formatting removed.""" - s = stripBold(s) s = stripColor(s) + s = stripBold(s) s = stripReverse(s) s = stripUnderline(s) return s.replace('\x0f', '').replace('\x0F', '') diff --git a/test/test_ircutils.py b/test/test_ircutils.py index fe3d904b9..4d863ca94 100644 --- a/test/test_ircutils.py +++ b/test/test_ircutils.py @@ -153,6 +153,8 @@ class FunctionsTestCase(SupyTestCase): self.assertEqual(ircutils.stripFormatting('\x02bold\x0302,04foo\x03' 'bar\x0f'), 'boldfoobar') + s = ircutils.mircColor('[', 'blue') + ircutils.bold('09:21') + self.assertEqual(ircutils.stripFormatting(s), '[09:21') def testSafeArgument(self): s = 'I have been running for 9 seconds'