mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 12:49:24 +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):
|
def stripFormatting(s):
|
||||||
"""Returns the string s, with all formatting removed."""
|
"""Returns the string s, with all formatting removed."""
|
||||||
s = stripBold(s)
|
|
||||||
s = stripColor(s)
|
s = stripColor(s)
|
||||||
|
s = stripBold(s)
|
||||||
s = stripReverse(s)
|
s = stripReverse(s)
|
||||||
s = stripUnderline(s)
|
s = stripUnderline(s)
|
||||||
return s.replace('\x0f', '').replace('\x0F', '')
|
return s.replace('\x0f', '').replace('\x0F', '')
|
||||||
|
@ -153,6 +153,8 @@ class FunctionsTestCase(SupyTestCase):
|
|||||||
self.assertEqual(ircutils.stripFormatting('\x02bold\x0302,04foo\x03'
|
self.assertEqual(ircutils.stripFormatting('\x02bold\x0302,04foo\x03'
|
||||||
'bar\x0f'),
|
'bar\x0f'),
|
||||||
'boldfoobar')
|
'boldfoobar')
|
||||||
|
s = ircutils.mircColor('[', 'blue') + ircutils.bold('09:21')
|
||||||
|
self.assertEqual(ircutils.stripFormatting(s), '[09:21')
|
||||||
|
|
||||||
def testSafeArgument(self):
|
def testSafeArgument(self):
|
||||||
s = 'I have been running for 9 seconds'
|
s = 'I have been running for 9 seconds'
|
||||||
|
Loading…
Reference in New Issue
Block a user