diff --git a/nw/core/tohtml.py b/nw/core/tohtml.py index 282717b3..61541f42 100644 --- a/nw/core/tohtml.py +++ b/nw/core/tohtml.py @@ -312,23 +312,24 @@ class ToHtml(Tokenizer): refTags = [] if theBits[0] in nwLabels.KEY_NAME: retText += "%s: " % nwLabels.KEY_NAME[theBits[0]] - if theBits[0] == nwKeyWords.TAG_KEY: - retText += "%s" % ( - theBits[1], theBits[1] - ) - else: - if self.genMode == self.M_PREVIEW: - for tTag in theBits[1:]: - refTags.append("%s" % ( - theBits[0][1:], tTag, tTag - )) - retText += ", ".join(refTags) + if len(theBits) > 1: + if theBits[0] == nwKeyWords.TAG_KEY: + retText += "%s" % ( + theBits[1], theBits[1] + ) else: - for tTag in theBits[1:]: - refTags.append("%s" % ( - tTag, tTag - )) - retText += ", ".join(refTags) + if self.genMode == self.M_PREVIEW: + for tTag in theBits[1:]: + refTags.append("%s" % ( + theBits[0][1:], tTag, tTag + )) + retText += ", ".join(refTags) + else: + for tTag in theBits[1:]: + refTags.append("%s" % ( + tTag, tTag + )) + retText += ", ".join(refTags) return "
%s
" % retText