DDG: show all lines of multiline zeroclick replies

Thanks to @nathan0 for pointing this out.

From: 0b0c1b59ab
This commit is contained in:
James Lu 2017-01-20 21:51:05 -08:00
parent f5a53a1965
commit 53318d142c
1 changed files with 2 additions and 2 deletions

View File

@ -164,10 +164,10 @@ class DDG(callbacks.Plugin):
item = td.text.split("Zero-click info:", 1)[1].strip()
td = td.parent.next_sibling.next_sibling.\
find("td")
# Condense newlines (<br> tags)
# Condense newlines (<br> tags). XXX: make these separators configurable.
for br in td.find_all('br'):
br.replace_with(' - ')
res = td.text.strip().split("\n")[0]
res = ' | '.join(td.text.strip().split("\n"))
try:
# Some zero-click results have an attached link to them.
link = td.a.get('href')