summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/highlight/highlight.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/highlight/highlight.go b/modules/highlight/highlight.go
index a2bf93ee92..1a64108139 100644
--- a/modules/highlight/highlight.go
+++ b/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
}