Spaces:
Runtime error
Runtime error
fix issue with adding title to any page
Browse filesin hindsight that was kind of obvious...
- 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 =
|
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...')
|