* INCR-230 - Run python-modernize and isort on common/lib/xmodule/xmodule, plus a few minor fixes suggested by Jeremy
18 lines
380 B
Python
18 lines
380 B
Python
from __future__ import absolute_import
|
|
|
|
from lxml import etree
|
|
|
|
|
|
def check_html(html):
|
|
'''
|
|
Check whether the passed in html string can be parsed by lxml.
|
|
Return bool success.
|
|
'''
|
|
parser = etree.HTMLParser()
|
|
try:
|
|
etree.fromstring(html, parser)
|
|
return True
|
|
except Exception: # pylint: disable=broad-except
|
|
pass
|
|
return False
|