1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-15 13:33:12 +02:00

Remove spurious newline in HTML output.

Fixes #29.
This commit is contained in:
Alec Thomas 2017-09-25 15:25:32 +10:00
parent 022592be12
commit b0295f66bd

View File

@ -137,7 +137,7 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []*chroma
fmt.Fprintf(w, "<body%s>\n", f.styleAttr(css, chroma.Background))
}
fmt.Fprintf(w, "<pre%s>\n", f.styleAttr(css, chroma.Background))
fmt.Fprintf(w, "<pre%s>", f.styleAttr(css, chroma.Background))
lines := splitTokensIntoLines(tokens)
lineDigits := len(fmt.Sprintf("%d", len(lines)))
highlightIndex := 0