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

Luna mishandles empty tags #29

Open
Legimet opened this issue Jul 9, 2024 · 1 comment
Open

Luna mishandles empty tags #29

Legimet opened this issue Jul 9, 2024 · 1 comment

Comments

@Legimet
Copy link
Contributor

Legimet commented Jul 9, 2024

The attached TNS file contains XML with an empty tag <sp:ctxt ang="1" cplx="1" comp="1"/>. Running Luna on this XML file produces a malformed TNS. This is because Luna's XML parsing does not detect that this is an empty tag, and thus when it sees the next end tag, it outputs the tag number associated with sp:ctxt.

Based on preliminary testing, it seems that the XML parsing/compression isn't even necessary. Just escaping Unicode seems to be enough. Furthermore, the XML compression doesn't even seem to produce smaller files, which is not that surprising since the XML gets deflated anyway. Maybe I'm missing something here, but it seems to me that we could just get rid of that code.

By the way, it seems that someone else had this issue a year ago: https://old.reddit.com/r/nspire/comments/x3mpy8/unable_to_open_tns_files_created_with_luna/

test.zip

@Vogtinator
Copy link
Contributor

Yeah, so far I've just used explicit close tags everywhere.

Based on preliminary testing, it seems that the XML parsing/compression isn't even necessary. Just escaping Unicode seems to be enough. Furthermore, the XML compression doesn't even seem to produce smaller files, which is not that surprising since the XML gets deflated anyway. Maybe I'm missing something here, but it seems to me that we could just get rid of that code.

I had the exact same thoughts. The XML compression is pretty much useless (arguably worse than useless), so I wonder why it was implemented. Maybe some versions didn't accept unmangled XML or it wasn't known that unmangled XML also works?

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

2 participants