mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-28 21:00:03 +02:00
Refactor more code in templates (#29236)
Follow #29165. * Introduce JSONTemplate to help to render JSON templates * Introduce JSEscapeSafe for templates. Now only use `{{ ... | JSEscape}}` instead of `{{ ... | JSEscape | Safe}}` * Simplify "UserLocationMapURL" useage (cherry picked from commit 31bb9f3247388b993c61a10190cfd512408ce57e)
This commit is contained in:
parent
bdf470785d
commit
81925ebb0c
11 changed files with 42 additions and 39 deletions
|
@ -52,3 +52,7 @@ func TestSubjectBodySeparator(t *testing.T) {
|
|||
"",
|
||||
"Insuficient\n--\nSeparators")
|
||||
}
|
||||
|
||||
func TestJSEscapeSafe(t *testing.T) {
|
||||
assert.EqualValues(t, `\u0026\u003C\u003E\'\"`, JSEscapeSafe(`&<>'"`))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue