Don't crash on self.title if no soup.head.title.

This commit is contained in:
Ethan Dalool 2020-03-19 11:59:57 -07:00
parent 13d5534dc0
commit 93b6cb9f75

View file

@ -76,7 +76,10 @@ class Article:
css=writing_rootdir.with_child('css').with_child('dark.css').absolute_path, css=writing_rootdir.with_child('css').with_child('dark.css').absolute_path,
return_soup=True, return_soup=True,
) )
if self.soup.head.title:
self.title = self.soup.head.title.get_text() self.title = self.soup.head.title.get_text()
else:
self.title = self.md_file.basename
tag_links = self.soup.find_all('a', {'class': 'tag_link'}) tag_links = self.soup.find_all('a', {'class': 'tag_link'})
for tag_link in tag_links: for tag_link in tag_links: