mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-06-10 16:39:41 +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
|
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) {
|
func HighlightSyntaxViaContent(content string) (htmlOut string) {
|
||||||
content = html.UnescapeString(content)
|
content = html.UnescapeString(content)
|
||||||
|
|
||||||
fallbackOut := content
|
fallbackOut := html.EscapeString(content)
|
||||||
|
|
||||||
// identify the language
|
// identify the language
|
||||||
lexer := lexers.Analyse(content)
|
lexer := lexers.Analyse(content)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue