Question/poll support

This commit is contained in:
Thomas Sileo
2019-04-14 19:17:54 +02:00
parent 4c0e81224f
commit be7648c9ed
7 changed files with 361 additions and 41 deletions

View File

@@ -20,11 +20,14 @@ def links_from_note(note):
tags_href.add(h)
links = set()
soup = BeautifulSoup(note["content"])
for link in soup.find_all("a"):
h = link.get("href")
if h.startswith("http") and h not in tags_href and is_url_valid(h):
links.add(h)
if "content" in note:
soup = BeautifulSoup(note["content"])
for link in soup.find_all("a"):
h = link.get("href")
if h.startswith("http") and h not in tags_href and is_url_valid(h):
links.add(h)
# FIXME(tsileo): support summary and name fields
return links