diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-12-05 02:17:48 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-12-05 02:52:23 +0100 |
| commit | d65d6edb0e1887871c4de6a4e8a1630927153eae (patch) | |
| tree | 962864b2793913332adfe390521eff747f4c4863 /core/encoding/entity/entity.odin | |
| parent | 3d72e80ccf0f382f03a1c9407c4728862c5bca91 (diff) | |
[xml] Improve XML tests, test `core:encoding/entity`.
Diffstat (limited to 'core/encoding/entity/entity.odin')
| -rw-r--r-- | core/encoding/entity/entity.odin | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/encoding/entity/entity.odin b/core/encoding/entity/entity.odin index 8742446e6..db1a5ad0b 100644 --- a/core/encoding/entity/entity.odin +++ b/core/encoding/entity/entity.odin @@ -115,7 +115,14 @@ decode_xml :: proc(input: string, options := XML_Decode_Options{}, allocator := We don't need to check if we need to write a `<`, because if it isn't CDATA or a comment, it couldn't have been part of an XML tag body to be decoded here. + + Keep in mind that we could already *be* inside a CDATA tag. + If so, write `>` as a literal and continue. */ + if in_data { + write_rune(&builder, '<') + continue + } in_data = _handle_xml_special(&t, &builder, options) or_return case ']': |