12345678910111213141516171819202122232425 |
- package util
- import "strings"
- // HTMLUnEscape html special char convert
- // " to space, & to &, < to <, > to >
- func HTMLUnEscape(url string) string {
- s := strings.Replace(url, """, "\"", -1)
- s = strings.Replace(s, "&", "&", -1)
- s = strings.Replace(s, "<", "<", -1)
- s = strings.Replace(s, ">", ">", -1)
- return s
- }
- // HTMLEscape html special char convert
- // space to ", & to &, < to <, > to >
- func HTMLEscape(url string) string {
- s := strings.Replace(url, "\"", """, -1)
- s = strings.Replace(s, "&", "&", -1)
- s = strings.Replace(s, "<", "<", -1)
- s = strings.Replace(s, ">", ">", -1)
- return s
- }
|