Skip to content

Support selfclosing tags#33

Open
iamtakingiteasy wants to merge 1 commit into
nbio:mainfrom
iamtakingiteasy:main
Open

Support selfclosing tags#33
iamtakingiteasy wants to merge 1 commit into
nbio:mainfrom
iamtakingiteasy:main

Conversation

@iamtakingiteasy

@iamtakingiteasy iamtakingiteasy commented Apr 21, 2026

Copy link
Copy Markdown

Adds support for emitting self-closing tags during serialization.

When encoder is parameterized with SelfClosing(true), any empty tag is serialized as a self-closing tag. This can also be manipulated on per tag-level if SelfClosing is updated before emitting StartElement token / after emitting any token other than EndElement following empty StartElement.

The state is tracked on printer level around all interactions with underlying writer.

@iamtakingiteasy

Copy link
Copy Markdown
Author

Expanded tests to cover non-empty content cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant