Files
edx-platform/common/lib/xmodule/xmodule/html_checker.py
Victor Shnayder 41eca8a0a5 Move files into xmodule module per comment on #326
* move html_checker.py
* move stringify.py
* move tests into module
* remove duplicate progress.py
* fix module imports
2012-08-02 10:13:58 -04:00

15 lines
313 B
Python

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 as err:
pass
return False