Commit b1a792e9 authored by Sebastian Pipping's avatar Sebastian Pipping

Fix entity lookup

git-svn-id: https://svn.xiph.org/websites/validator.xspf.org@15319 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 30e6e3aa
......@@ -1201,7 +1201,14 @@ def handleEntityDeclaration(entityName, is_parameter_entity, value, base, system
valueLen += start - lastend
entityRefName = value[start + 1: end - 1]
entityInfo = entityNameToValueLen[entityRefName]
try:
entityInfo = entityNameToValueLen[entityRefName]
except KeyError:
entityInfo = {
'valueLen' : 1,
'lookupSum' : 0,
'lookupDepth' : 0,
}
valueLen += entityInfo['valueLen']
lookupSum += 1 + entityInfo['lookupSum']
lookupDepth = max(1 + entityInfo['lookupDepth'], lookupDepth)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment