Protection from crashing on unknown (new) markup

svn: r15381
This commit is contained in:
Doug Blank 2010-05-09 23:51:29 +00:00
parent 380490c6a2
commit 3430c34988

View File

@ -228,7 +228,9 @@ class DocBackend(object):
typeval = int(s_tag.name)
s_tagvalue = s_tag.value
tag_name = None
if tagtype.STYLE_TYPE[typeval] == bool:
if typeval not in tagtype.STYLE_TYPE:
return None
elif tagtype.STYLE_TYPE[typeval] == bool:
return self.STYLETAG_MARKUP[self.STYLETYPE_MAP[typeval]]
elif tagtype.STYLE_TYPE[typeval] == str:
tag_name = "%d %s" % (typeval, s_tagvalue)