forked from MirrorHub/synapse
Don't infer paragrahs from newlines
This commit is contained in:
parent
6b58ade2f0
commit
58c9653c6b
1 changed files with 1 additions and 2 deletions
|
@ -344,9 +344,8 @@ class PreviewUrlResource(Resource):
|
||||||
# Split all the text nodes into paragraphs (by splitting on new
|
# Split all the text nodes into paragraphs (by splitting on new
|
||||||
# lines)
|
# lines)
|
||||||
text_nodes = (
|
text_nodes = (
|
||||||
line.strip()
|
re.sub(r'\s+', '\n', el.text).strip()
|
||||||
for el in cloned_tree.iter() if el.text
|
for el in cloned_tree.iter() if el.text
|
||||||
for line in el.text.splitlines()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Try to get a summary of between 200 and 500 words, respecting
|
# Try to get a summary of between 200 and 500 words, respecting
|
||||||
|
|
Loading…
Reference in a new issue