diff options
| author | 2019-02-09 10:38:44 +0000 | |
|---|---|---|
| committer | 2019-02-09 10:38:44 +0000 | |
| commit | 9f6aa93082b9adafef5d2555d8824bd6181582db (patch) | |
| tree | abc7db79880e811b1f47af55fb9481f7e6bd92b7 /modules | |
| parent | Add a setting to get the title from URLs automatically (title.py) (diff) | |
| signature | ||
Actually return title text, not html Tag object (title.py)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/title.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/title.py b/modules/title.py index e069d637..a5a302ee 100644 --- a/modules/title.py +++ b/modules/title.py @@ -13,7 +13,11 @@ class Module(ModuleManager.BaseModule): except Exception as e: self.log.error("failed to get URL title", exc_info=True) return None - return page.data.title + if page.data.title: + return page.data.title.text.replace("\n", " ").replace( + "\r", "").replace(" ", " ").strip() + else: + return None @utils.hook("received.message.channel") def channel_message(self, event): |
