zdravko/internal/script/script.go
Tine c153fe1b8f
feat: readability imrovements, new pages, script escaping
Progress towards finalizing the building blocks: targets, monitors, triggers, notifications and worker groups.
2024-05-14 21:38:45 +02:00

16 lines
293 B
Go

package script
import (
"html"
"regexp"
"strings"
)
func EscapeString(s string) string {
re := regexp.MustCompile(`\r?\n`)
return re.ReplaceAllString(html.EscapeString(s), `\n`)
}
func UnescapeString(s string) string {
return html.UnescapeString(strings.Replace(s, `\n`, "\n", -1))
}