mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-28 18:21:17 +00:00
Tine
c153fe1b8f
Progress towards finalizing the building blocks: targets, monitors, triggers, notifications and worker groups.
16 lines
293 B
Go
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))
|
|
}
|