Browse Source

Escape failed highlighted code (#12685)

Signed-off-by: Andrew Thornton <art27@cantab.net>
tags/v1.13.0-rc1
zeripath 5 years ago committed by GitHub
parent
commit
dead2a9b2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      modules/highlight/highlight.go

3
modules/highlight/highlight.go

@ -8,6 +8,7 @@ package highlight
import (
"bufio"
"bytes"
gohtml "html"
"path/filepath"
"strings"
"sync"
@ -160,7 +161,7 @@ func plainText(code string, numLines int) map[int]string {
if content == "" {
content = "\n"
}
m[line] = content
m[line] = gohtml.EscapeString(content)
}
return m
}

Loading…
Cancel
Save