Skip to content

Commit

Permalink
Escape failed highlighted code (go-gitea#12685)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored Sep 2, 2020
1 parent 72eeb13 commit dead2a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/highlight/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package highlight
import (
"bufio"
"bytes"
gohtml "html"
"path/filepath"
"strings"
"sync"
Expand Down Expand Up @@ -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
}

0 comments on commit dead2a9

Please sign in to comment.