diff options
| author | 2019-06-05 12:05:51 +0100 | |
|---|---|---|
| committer | 2019-06-05 12:05:51 +0100 | |
| commit | 0d64f55215c2f65e1848d2235cd698a1ab39d9eb (patch) | |
| tree | e1fb524817e326985ae8c05c1db64f9955c46c3c /modules | |
| parent | Update CHANGELOG (diff) | |
| signature | ||
Strip html from !define/!randomword output
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/define.py | 7 |
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: |
