Skip to content

Line Feed hex character entity in attributes is missing #189

@magraina

Description

@magraina

Describe the bug
The hex character entity 
 get's converted to a new line character \n.
I did not expect such a conversion and I could not find any config to prevent this behavior.

Input

<?xml version="1.0" encoding="UTF-8"?>
<content>
  <Label text="SUPPLY&#xa;AIR"/>
</content>

Code

const doc = create(xmlInput);
doc.end({ prettyPrint: true });

Output

<?xml version="1.0" encoding="UTF-8"?>
<content>
  <Label text="SUPPLY
AIR"/>
</content>

Expected behavior
I'm expecting that input and output are the same - &#xa; remains and don't get's converted to a new line character.

Version:

  • node.js: [22.8.0]
  • xmlbuilder2 [3.1.1]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions