mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-06 10:19:11 +01:00
Escape failed highlighted code (#12685)
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
72eeb13e4d
commit
dead2a9b2d
1 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@ package highlight
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
gohtml "html"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -160,7 +161,7 @@ func plainText(code string, numLines int) map[int]string {
|
||||||
if content == "" {
|
if content == "" {
|
||||||
content = "\n"
|
content = "\n"
|
||||||
}
|
}
|
||||||
m[line] = content
|
m[line] = gohtml.EscapeString(content)
|
||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue