Fix lenHTML() with empty string
parent
e05d1c9deb
commit
bbf5c92ba2
5
morss.py
5
morss.py
|
@ -70,7 +70,10 @@ def cleanXML(xml):
|
||||||
return xml.translate(table, table[:32]).lstrip()
|
return xml.translate(table, table[:32]).lstrip()
|
||||||
|
|
||||||
def lenHTML(txt):
|
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):
|
def parseOptions(available):
|
||||||
options = None
|
options = None
|
||||||
|
|
Loading…
Reference in New Issue