mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve escaping https://github.com/siyuan-note/siyuan/issues/13135
This commit is contained in:
parent
7b342fc004
commit
a2a46f8f39
3 changed files with 4 additions and 22 deletions
|
|
@ -83,21 +83,7 @@ func EscapeHTML(s string) (ret string) {
|
|||
return
|
||||
}
|
||||
|
||||
ret = strings.ReplaceAll(ret, "&", "__@amp__")
|
||||
ret = strings.ReplaceAll(ret, "'", "__@39__")
|
||||
ret = strings.ReplaceAll(ret, "<", "__@lt__")
|
||||
ret = strings.ReplaceAll(ret, ">", "__@gt__")
|
||||
ret = strings.ReplaceAll(ret, """, "__@34__")
|
||||
ret = strings.ReplaceAll(ret, " ", "__@13__")
|
||||
ret = html.EscapeString(ret)
|
||||
ret = strings.ReplaceAll(ret, "__@amp__", "&")
|
||||
ret = strings.ReplaceAll(ret, "__@39__", "'")
|
||||
ret = strings.ReplaceAll(ret, "__@lt__", "<")
|
||||
ret = strings.ReplaceAll(ret, "__@gt__", ">")
|
||||
ret = strings.ReplaceAll(ret, "__@34__", """)
|
||||
ret = strings.ReplaceAll(ret, "__@13__", " ")
|
||||
ret = strings.ReplaceAll(ret, "<", "&lt;")
|
||||
ret = strings.ReplaceAll(ret, ">", "&gt;")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue