Skip to content

Trailing whitespace added to text of elements with namespaces#5

Open
bbpennel wants to merge 2 commits intovkiryukhin:masterfrom
bbpennel:master
Open

Trailing whitespace added to text of elements with namespaces#5
bbpennel wants to merge 2 commits intovkiryukhin:masterfrom
bbpennel:master

Conversation

@bbpennel
Copy link
Copy Markdown

@bbpennel bbpennel commented Jul 1, 2013

An issue I'm having is that when a tag contains a namespace it causes the closing tag of the element to drop to a new line and indent, which adds additional whitespace into the text.

vkbeautify.xml('<root><child xmlns="ns">Text</child></root>');

Produces:

<root>
    <child 
        xmlns="ns">Text
    </child>
</root>

This pull request prevents that newline and indent from being added to elements when they have namespaces.

<root>
    <child
        xmlns="ns">test</child>
</root>

Indentation should still be working correctly for elements nested in elements with namespaces.

vkbeautify.xml('<root><child xmlns="ns"><test></test></child></root>');

Produces:

<root>
    <child
        xmlns="ns">
        <test></test>
    </child>
</root>

And thanks for making this great tool!

@SunboX
Copy link
Copy Markdown

SunboX commented Jul 21, 2014

good job, thx a lot! 👍

@gentisaliu
Copy link
Copy Markdown

Good job! 👍

@Stalinec
Copy link
Copy Markdown

Is this fix supposed to be approved?
There is the same issue in the latest version: 0.99.3

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.

4 participants