Fixed out of bounds crash in HTML converter
This commit is contained in:
+17
-16
@@ -312,23 +312,24 @@ class ToHtml(Tokenizer):
|
|||||||
refTags = []
|
refTags = []
|
||||||
if theBits[0] in nwLabels.KEY_NAME:
|
if theBits[0] in nwLabels.KEY_NAME:
|
||||||
retText += "<span class='tags'>%s:</span> " % nwLabels.KEY_NAME[theBits[0]]
|
retText += "<span class='tags'>%s:</span> " % nwLabels.KEY_NAME[theBits[0]]
|
||||||
if theBits[0] == nwKeyWords.TAG_KEY:
|
if len(theBits) > 1:
|
||||||
retText += "<a name='tag_%s'>%s</a>" % (
|
if theBits[0] == nwKeyWords.TAG_KEY:
|
||||||
theBits[1], theBits[1]
|
retText += "<a name='tag_%s'>%s</a>" % (
|
||||||
)
|
theBits[1], theBits[1]
|
||||||
else:
|
)
|
||||||
if self.genMode == self.M_PREVIEW:
|
|
||||||
for tTag in theBits[1:]:
|
|
||||||
refTags.append("<a href='#%s=%s'>%s</a>" % (
|
|
||||||
theBits[0][1:], tTag, tTag
|
|
||||||
))
|
|
||||||
retText += ", ".join(refTags)
|
|
||||||
else:
|
else:
|
||||||
for tTag in theBits[1:]:
|
if self.genMode == self.M_PREVIEW:
|
||||||
refTags.append("<a href='#tag_%s'>%s</a>" % (
|
for tTag in theBits[1:]:
|
||||||
tTag, tTag
|
refTags.append("<a href='#%s=%s'>%s</a>" % (
|
||||||
))
|
theBits[0][1:], tTag, tTag
|
||||||
retText += ", ".join(refTags)
|
))
|
||||||
|
retText += ", ".join(refTags)
|
||||||
|
else:
|
||||||
|
for tTag in theBits[1:]:
|
||||||
|
refTags.append("<a href='#tag_%s'>%s</a>" % (
|
||||||
|
tTag, tTag
|
||||||
|
))
|
||||||
|
retText += ", ".join(refTags)
|
||||||
|
|
||||||
return "<div>%s</div>" % retText
|
return "<div>%s</div>" % retText
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user