aboutsummaryrefslogtreecommitdiff
path: root/modules/define.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-05 12:05:51 +0100
committerGravatar jesopo2019-06-05 12:05:51 +0100
commit0d64f55215c2f65e1848d2235cd698a1ab39d9eb (patch)
treee1fb524817e326985ae8c05c1db64f9955c46c3c /modules/define.py
parentUpdate CHANGELOG (diff)
signature
Strip html from !define/!randomword output
Diffstat (limited to 'modules/define.py')
-rw-r--r--modules/define.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/define.py b/modules/define.py
index 42540a5c..e7813ccf 100644
--- a/modules/define.py
+++ b/modules/define.py
@@ -35,8 +35,8 @@ class Module(ModuleManager.BaseModule):
page = self._get_definition(word)
if page:
if len(page.data):
- event["stdout"].write("%s: %s" % (page.data[0]["word"],
- page.data[0]["text"]))
+ text = utils.http.strip_html(page.data[0]["text"])
+ event["stdout"].write("%s: %s" % (page.data[0]["word"], text))
else:
event["stderr"].write("No definitions found")
else:
@@ -61,8 +61,9 @@ class Module(ModuleManager.BaseModule):
else:
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" % (
- page.data["word"], definition["text"]))
+ page.data["word"], text))
else:
raise utils.EventsResultsError()
else: