aboutsummaryrefslogtreecommitdiff
path: root/forged/internal/render/escape.go
blob: 031e333e3a099d5942d6f76ae22d6f1c286cf6e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>

package render

import (
	"html"
	"html/template"
)

// EscapeHTML just escapes a string and wraps it in [template.HTML].
func EscapeHTML(s string) template.HTML {
	return template.HTML(html.EscapeString(s)) //#nosec G203
}