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

Blank space in XMLNode.content is trimmed away. #27

Open
elenakrittik opened this issue May 5, 2024 · 0 comments
Open

Blank space in XMLNode.content is trimmed away. #27

elenakrittik opened this issue May 5, 2024 · 0 comments

Comments

@elenakrittik
Copy link
Owner

elenakrittik commented May 5, 2024

The problem is that when you have a node with content that has spaces, these spaces will get removed from the edges when parsing.

Yep, that's intentional (but can be reverted, of course). I did it because i don't think that with, e.g.:

<node>
  Hello!
</node>

..one would expected the content to be "\n Hello!\n". At the same time i recognize that this practically forbids you from having multiline content, but that's an intentional trade-off i made in my mind when i've written it. Personally, my rule of thumb is "single-line data => make it an attribute; multi-line data => make it a CDATA", but i'm always open to feedback and we can change that (under an option).

Reading the comment, it seems like a workaround for a Godot xml parser problem?

In this case, it's more of an "unwanted" thing than an "issue" (the _cleanup_double_blankets() function below does exist to workaround an issue, but i assume that's out of your concern?).

Originally posted by @elenakrittik in #26 (comment)

It's probably better to leave trimming to the user, but i'm afraid of this being too breaking

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

No branches or pull requests

1 participant