use bleach to clean up cruddy html

workspace
Brendan Howell 8 years ago
parent 2a755efc18
commit 99c9d1a5b0

@ -7,9 +7,9 @@ import random
import string import string
import urllib.request, urllib.parse, urllib.error import urllib.request, urllib.parse, urllib.error
import bleach
import code128 import code128
import feedparser import feedparser
import html5tidy
import lxml.html import lxml.html
import PIL import PIL
from readability import readability from readability import readability
@ -204,7 +204,7 @@ class Publications(Bureau):
end = entry.summary.rfind(" ", 0, 499) end = entry.summary.rfind(" ", 0, 499)
entry.summary = entry.summary[0:end] + "" entry.summary = entry.summary[0:end] + ""
entry.summary = html5tidy.tidy(entry.summary, fragment=True) entry.summary = bleach.clean(entry.summary, strip=True)
entries.append(entry) entries.append(entry)

Loading…
Cancel
Save