Skip to content

Print inserted XML attributes and child elements - #189

Open
Shaisolaris wants to merge 2 commits into
trailofbits:masterfrom
Shaisolaris:issue-186
Open

Print inserted XML attributes and child elements#189
Shaisolaris wants to merge 2 commits into
trailofbits:masterfrom
Shaisolaris:issue-186

Conversation

@Shaisolaris

Copy link
Copy Markdown

Fixes #186

print_XMLElement skipped an empty attrib dict and an empty child list, so the first added attribute or a new child never reached SequenceFormatter.

The formatter now always prints attrib. It also prints children when they have a non-Match edit, so an empty element does not stay self-closing over an insert. Unchanged empty elements still self-close.

Tests cover adding the first attribute, inserting a child next to text, inserting a child into an empty element, adding an attribute when one already exists, and leaving an empty element unchanged.

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.

XML formatter drops inserted attributes and child elements

1 participant