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

Including ]]> in a property that will be wrapped in CDATA results in an invalid XML file being produced #309

Open
raymondnumbergenerator opened this issue Sep 29, 2022 · 2 comments

Comments

@raymondnumbergenerator
Copy link

Any script containing a comment or string with the sequence ]]> ends the CDATA section early and produces an invalid xml when building rbxmx.

@Dekkonot Dekkonot transferred this issue from rojo-rbx/rojo Jul 2, 2023
@Dekkonot
Copy link
Member

Dekkonot commented Jul 2, 2023

Sorry that it's taken almost a year to followup on this. This is actually an issue with rbx-dom, so I've transferred it there.

This is an issue I've been aware of for a while but I'm not sure what to do with it. We only write CDATA when a string has leading or trailing whitespace, including script sources, so that we can preserve the whitespace. I'm not sure what Roblox does in this case but for us, the only option would be to check properties for that sequence (which is expensive) and then either lose leading/trailing whitespace or break the property into multiple CDATA, which I'm not sure if Roblox even supports. It also hurts readability.

If it's urgent, we can go through the effort of supporting it but my advice is "don't do that" generally or if you have to, don't also have trailing or leading whitespace.

@Dekkonot Dekkonot changed the title Unescaped escape sequence produces invalid rbxmx XML Including ]]> in a property that will be wrapped in CDATA results in an invalid XML file being produced Jul 2, 2023
@raymondnumbergenerator
Copy link
Author

Hey! Thanks for the response. It's not urgent at all, just ran across it by accident and it was a pain to debug so wanted to make sure there was a public record of the issue so someone else running into it again can find it online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants