Escaping
This commit is contained in:
+3
-1
@@ -5,8 +5,10 @@ import "core:strings"
|
||||
import "core:unicode"
|
||||
|
||||
escape_html :: proc(s: string, allocator := context.temp_allocator) -> string {
|
||||
escaped := decode_escapes(s, allocator)
|
||||
|
||||
b := strings.builder_make(allocator)
|
||||
for ch in s {
|
||||
for ch in escaped {
|
||||
switch ch {
|
||||
case '&':
|
||||
strings.write_string(&b, "&")
|
||||
|
||||
Reference in New Issue
Block a user