mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
Allerhand Kleinigkeiten; Einzelansichten Reihen u Personen; Bandansicht
This commit is contained in:
@@ -4,6 +4,10 @@ func Length(arr []any) int {
|
||||
return len(arr)
|
||||
}
|
||||
|
||||
func MapLen[T comparable, U any](m map[T]U) int {
|
||||
return len(m)
|
||||
}
|
||||
|
||||
func Contains(arr []string, val string) bool {
|
||||
for _, v := range arr {
|
||||
if v == val {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package functions
|
||||
|
||||
import "html/template"
|
||||
import (
|
||||
"html/template"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Safe(s string) template.HTML {
|
||||
if len(s) == 0 {
|
||||
@@ -8,3 +11,7 @@ func Safe(s string) template.HTML {
|
||||
}
|
||||
return template.HTML(s)
|
||||
}
|
||||
|
||||
func ReplaceSlashParen(s string) string {
|
||||
return strings.ReplaceAll(s, "/)", "<p>")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user