Strip html from !define/!randomword output
This commit is contained in:
parent
e620b72238
commit
0d64f55215
1 changed files with 4 additions and 3 deletions
|
@ -35,8 +35,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
page = self._get_definition(word)
|
page = self._get_definition(word)
|
||||||
if page:
|
if page:
|
||||||
if len(page.data):
|
if len(page.data):
|
||||||
event["stdout"].write("%s: %s" % (page.data[0]["word"],
|
text = utils.http.strip_html(page.data[0]["text"])
|
||||||
page.data[0]["text"]))
|
event["stdout"].write("%s: %s" % (page.data[0]["word"], text))
|
||||||
else:
|
else:
|
||||||
event["stderr"].write("No definitions found")
|
event["stderr"].write("No definitions found")
|
||||||
else:
|
else:
|
||||||
|
@ -61,8 +61,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
else:
|
else:
|
||||||
raise utils.EventError("Try again in a couple of seconds")
|
raise utils.EventError("Try again in a couple of seconds")
|
||||||
|
|
||||||
|
text = utils.http.strip_html(definition["text"])
|
||||||
event["stdout"].write("Random Word: %s - Definition: %s" % (
|
event["stdout"].write("Random Word: %s - Definition: %s" % (
|
||||||
page.data["word"], definition["text"]))
|
page.data["word"], text))
|
||||||
else:
|
else:
|
||||||
raise utils.EventsResultsError()
|
raise utils.EventsResultsError()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue