aboutsummaryrefslogtreecommitdiff
path: root/modules/title.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-02-09 10:38:44 +0000
committerGravatar jesopo2019-02-09 10:38:44 +0000
commit9f6aa93082b9adafef5d2555d8824bd6181582db (patch)
treeabc7db79880e811b1f47af55fb9481f7e6bd92b7 /modules/title.py
parentAdd 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/title.py')
-rw-r--r--modules/title.py6
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):