You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(internal): marshal self-closing tags in XML (#1225)
Currently self-closing tags are marshaled as `<a></a>` which is not the
preferred format `<a/>`.
With the current implementation of `encoding/xml`, self-closing tags are
expanded to `StartElement` and `EndElement` so both elements are written
to output.
In this PR, a field `Empty` is added to both elements to indicate
whether the current element is empty. During encoding:
- `/` is written before `>` for an empty `StartElement`
- nothing will be written for an empty `EndElement`
Considering that we only want tabs not being escaped, this PR modifies
`escapeNewline` to `escapeWhitespace` to indicate if we want all
whitespace characters escaped.
0 commit comments