Make sure we utils.htmlToText the aspnSnarfer, otherwise we can get nasty

replies because of the embedded \n.
This commit is contained in:
James Vega 2005-01-05 18:38:17 +00:00
parent f31fec5681
commit d85e56f1d2
2 changed files with 4 additions and 0 deletions

View File

@ -192,6 +192,7 @@ class Python(callbacks.PrivmsgCommandAndRegexp):
if m: if m:
resp.append('%s: %s' % self._bold(m.groups())) resp.append('%s: %s' % self._bold(m.groups()))
if resp: if resp:
resp = map(utils.htmlToText, resp)
irc.reply('; '.join(resp), prefixName = False) irc.reply('; '.join(resp), prefixName = False)
aspnRecipes = urlSnarfer(aspnRecipes) aspnRecipes = urlSnarfer(aspnRecipes)

View File

@ -64,6 +64,9 @@ class PythonTestCase(PluginTestCase, PluginDocumentation):
'http://aspn.activestate.com/ASPN/Cookbook/Python/' 'http://aspn.activestate.com/ASPN/Cookbook/Python/'
'Recipe/230113', 'Recipe/230113',
'Implementation of sets using sorted lists') 'Implementation of sets using sorted lists')
self.assertNotRegexp('http://aspn.activestate.com/ASPN/'
'Cookbook/Python/Recipe/144183',
'\n')
finally: finally:
conf.supybot.plugins.Python.aspnSnarfer.setValue(False) conf.supybot.plugins.Python.aspnSnarfer.setValue(False)