Skip to content

XMLBuilder line break behavior change after upgrading #605

@afbpinheiro

Description

@afbpinheiro
  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?

Description

After upgrading from 3.17.4 to 4.2.7 there was an unexpected change in how XMLBuilder behaved regarding putting line breaks in empty elements.

Input

Code

const builder = new XMLBuilder({
        format: true,
});
const xml = builder.build({ root: { profile: [] } });
console.log(xml);

Output

<root></root>

expected data

<root>
</root>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions