Fix lenHTML() with empty string

master
pictuga 2013-06-08 17:30:11 +02:00
parent e05d1c9deb
commit bbf5c92ba2
1 changed files with 4 additions and 1 deletions

View File

@ -70,7 +70,10 @@ def cleanXML(xml):
return xml.translate(table, table[:32]).lstrip()
def lenHTML(txt):
return len(lxml.html.fromstring(txt).text_content())
if len(txt):
return len(lxml.html.fromstring(txt).text_content())
else:
return 0
def parseOptions(available):
options = None