mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-04-19 21:39:24 +00:00
fix: escape code blocks to prevent HTML injection
This commit is contained in:
parent
8f9091fb2a
commit
5bd9ce484f
2 changed files with 2 additions and 2 deletions
|
@ -1,3 +1,3 @@
|
|||
package config
|
||||
|
||||
var Version = "1.2"
|
||||
var Version = "1.2.1"
|
||||
|
|
|
@ -17,7 +17,7 @@ var plainFormattedCodeRegex = regexp.MustCompile(`(?s)<pre tabindex="0" class="c
|
|||
func HighlightSyntaxViaContent(content string) (htmlOut string) {
|
||||
content = html.UnescapeString(content)
|
||||
|
||||
fallbackOut := content
|
||||
fallbackOut := html.EscapeString(content)
|
||||
|
||||
// identify the language
|
||||
lexer := lexers.Analyse(content)
|
||||
|
|
Loading…
Add table
Reference in a new issue