philipp-zettl commited on
Commit
5fce8f8
1 Parent(s): 941ea0e

fix issue with adding title to any page

Browse files

in hindsight that was kind of obvious...

Files changed (1) hide show
  1. src/text.py +1 -1
src/text.py CHANGED
@@ -100,7 +100,7 @@ def doctree_from_url(url, elem_class='div', class_name='article-body'):
100
  article = extract_article(url)
101
  # convert to MD to handle splitting better
102
  article_content = select_content(article.html, elem_class, class_name)
103
- requires_title = not any(filter(lambda x: x.strip().startswith('# '), article_content.split('\n')))
104
 
105
  if requires_title:
106
  print('Didn\'t find title, will add it manually...')
 
100
  article = extract_article(url)
101
  # convert to MD to handle splitting better
102
  article_content = select_content(article.html, elem_class, class_name)
103
+ requires_title = list(filter(lambda x: x.strip().startswith('# '), article_content.split('\n'))) != []
104
 
105
  if requires_title:
106
  print('Didn\'t find title, will add it manually...')