mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Handling SerialisationError
This commit is contained in:
parent
5e2e237871
commit
dffcd484d9
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@ import sys
|
|||
from random import randint
|
||||
from html.parser import HTMLParser
|
||||
from lxml.html.diff import tokenize, fixup_ins_del_tags, htmldiff_tokens
|
||||
from lxml.etree import ParserError, XMLSyntaxError
|
||||
from lxml.etree import ParserError, XMLSyntaxError, SerialisationError
|
||||
import lxml.html, lxml.etree
|
||||
from lxml.html.clean import Cleaner
|
||||
from itertools import chain
|
||||
|
@ -269,7 +269,7 @@ def strip_comments__lxml(html_string=""):
|
|||
clean_html = cleaner.clean_html(html)
|
||||
|
||||
return lxml.etree.tostring(clean_html).decode()
|
||||
except (XMLSyntaxError, ParserError):
|
||||
except (XMLSyntaxError, ParserError, SerialisationError):
|
||||
return html_string
|
||||
|
||||
def prep_for_search(html):
|
||||
|
|
Loading…
Add table
Reference in a new issue