Fix bug in number of spaces in rainbows

This commit is contained in:
Tulir Asokan 2020-03-20 14:41:10 +02:00
parent 87b394abec
commit ae3e7e2ad9

View File

@ -70,6 +70,7 @@ func (r *RainbowRenderer) RenderNode(w io.Writer, node *blackfriday.Node, enteri
runes := graphemes.Runes() runes := graphemes.Runes()
if len(runes) == 1 && unicode.IsSpace(runes[0]) { if len(runes) == 1 && unicode.IsSpace(runes[0]) {
buf.WriteRune(runes[0]) buf.WriteRune(runes[0])
continue
} }
_, _ = fmt.Fprintf(&buf, "<font color=\"%s\">%s</font>", r.ColorID, graphemes.Str()) _, _ = fmt.Fprintf(&buf, "<font color=\"%s\">%s</font>", r.ColorID, graphemes.Str())
} }