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 = "<" - case '>': s = ">" - case '"': s = """ + case '&': x = "&" + case '\'': x = "'" + case '<': x = "<" + case '>': x = ">" + case '"': x = """ } - if s != "" { - copy(t[w:], s) - w += len(s) + if x != "" { + copy(t[w:], x) + w += len(x) } else { t[w] = c w += 1