aboutsummaryrefslogtreecommitdiff
path: root/core/encoding/entity/entity.odin
diff options
context:
space:
mode:
Diffstat (limited to 'core/encoding/entity/entity.odin')
-rw-r--r--core/encoding/entity/entity.odin18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/encoding/entity/entity.odin b/core/encoding/entity/entity.odin
index 0d455ef88..95a404a81 100644
--- a/core/encoding/entity/entity.odin
+++ b/core/encoding/entity/entity.odin
@@ -300,17 +300,17 @@ escape_html :: proc(s: string, allocator := context.allocator, loc := #caller_lo
w := 0
for c in b {
- s := ""
+ x := ""
switch c {
- case '&': s = "&"
- case '\'': s = "'"
- case '<': s = "&lt;"
- case '>': s = "&gt;"
- case '"': s = "&#34;"
+ case '&': x = "&amp;"
+ case '\'': x = "&#39;"
+ case '<': x = "&lt;"
+ case '>': x = "&gt;"
+ case '"': x = "&#34;"
}
- if s != "" {
- copy(t[w:], s)
- w += len(s)
+ if x != "" {
+ copy(t[w:], x)
+ w += len(x)
} else {
t[w] = c
w += 1