Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing whitespace added to text of elements with namespaces #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bbpennel
Copy link

@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

SunboX commented Jul 21, 2014

good job, thx a lot! 👍

@gentisaliu
Copy link

Good job! 👍

@Stalinec
Copy link

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