Open
Description
Describe the bug
With end({ prettyPrint: true }) mixed inline content is written to a new line, introducing spaces in XML viewers. (e.g. a text will render as "It's bold ." instead of "It's bold.")
To Reproduce
Given the following XML
<sec sec-type="chapter"><title>Introduction</title><p>It's <b>bold</b>.</p></sec>
calling end({ prettyPrint: true }) results in the following output:
<title> Introduction </title>It's bold .
Expected behavior
I would have expected the p element to keep all inline content
<sec sec-type="chapter">
<title>Introduction</title>
<p>It's <b>bold</b>.</p>
</sec>
There is a test for mixed content that tests for the current behavior, I am unsure whether that is correct (Oxygen XML and other editors format the text as expected).
Version:
- node.js: 16.x
- xmlbuilder2 3.0.1
Additional context
Highly appreciate this straightforward library! I hope the issue makes sense.