rbx-dom icon indicating copy to clipboard operation
rbx-dom copied to clipboard

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

Open raymondnumbergenerator opened this issue 3 years ago • 2 comments

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

raymondnumbergenerator avatar Sep 29 '22 00:09 raymondnumbergenerator

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 avatar Jul 02 '23 01:07 Dekkonot

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.

raymondnumbergenerator avatar Sep 01 '23 06:09 raymondnumbergenerator