Skip to content

Trailing whitespace in processing instructions not preserved #497

Description

@shunkica

Describe the bug
Trailing whitespace in PI is not preserved.
One trailing whitespace is preserved if the PI does not have data.

To Reproduce
https://stackblitz.com/edit/js-xmldom-template-mcmkty?file=index.js

Expected behavior
The PI without data should have no trailing whitespace.
The trailing whitespace in PI with data should be preserved.
From DOM Level 1 spec:

Attributes
target
The target of this processing instruction. XML defines this as being the first token following the markup that begins the processing instruction.
data
The content of this processing instruction. This is from the first non white space character after the target to the character immediately preceding the ?>.

Runtime & Version:
xmldom version: 0.8.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp-wantedExternal contributions welcomespec:DOM-Level-2https://www.w3.org/TR/DOM-Level-2-Core/xml:well-formedhttps://www.w3.org/TR/xml11/#dt-wellformed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions