diff --git a/core/encoding/entity/entity.odin b/core/encoding/entity/entity.odin index a756bdf39..3f3d41953 100644 --- a/core/encoding/entity/entity.odin +++ b/core/encoding/entity/entity.odin @@ -146,6 +146,7 @@ decode_xml :: proc(input: string, options := XML_Decode_Options{}, allocator := for i in 0..A & B` + + opts := xml.Options{ + flags = {.Ignore_Unsupported, .Decode_SGML_Entities}, + } + + doc, err := xml.parse_bytes(transmute([]byte)s, opts) + defer xml.destroy(doc) + assert(err == .None) + + testing.expect_value(t, doc.elements[0].value[0], "A & B") + attr := doc.elements[0].attribs + testing.expect_value(t, attr[0].val, "A & B") +} + @(private) doc_to_string :: proc(doc: ^xml.Document) -> (result: string) { /* @@ -298,4 +322,4 @@ doc_to_string :: proc(doc: ^xml.Document) -> (result: string) { print(strings.to_writer(&buf), doc) return strings.clone(strings.to_string(buf)) -} +} \ No newline at end of file