mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-12 13:49:23 +01:00
Fixed a bug in stripFormatting.
This commit is contained in:
parent
3db50c1a2b
commit
127e9f3ccf
@ -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', '')
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user