Make highlightCodeBlock render enclosing div tags on separate lines

This commit is contained in:
Niklas Fasching 2018-12-11 16:08:58 +01:00
parent 53b61abfd0
commit b1a03e2d27
6 changed files with 18 additions and 8 deletions

View file

@ -50,5 +50,5 @@ func highlightCodeBlock(source, lang string) string {
l = chroma.Coalesce(l)
it, _ := l.Tokenise(nil, source)
_ = html.New().Format(&w, styles.Get("friendly"), it)
return `<div class="highlight">` + w.String() + `</div>`
return `<div class="highlight">` + "\n" + w.String() + "\n" + `</div>`
}