Skip to content

Improve xml.xml_escape() to handle non-printable characters - #514

Merged
Tieske merged 9 commits into
lunarmodules:masterfrom
yeshan333:improve_xml_escape
Jan 31, 2026
Merged

Improve xml.xml_escape() to handle non-printable characters#514
Tieske merged 9 commits into
lunarmodules:masterfrom
yeshan333:improve_xml_escape

Conversation

@yeshan333

Copy link
Copy Markdown
Contributor

Rename escape_table to xml_escape_table and enhance the XML escaping functionality to handle non-printable control characters and preserve high bytes for UTF-8 support. Update tests to cover new escaping behavior.

@Tieske Tieske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is failing... did you even test this? Looks AI generated afaict.

@Tieske Tieske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there's just tests escaping, it should also get tests doing a roundtrip.

1. Incorrect UTF-8 handling (was escaping 128-255, breaking multi-byte chars)
2. Wrong test expectations for high byte values
3. Test code merge issues during editing
@yeshan333

Copy link
Copy Markdown
Contributor Author

Yes, the test cases are AI-generated. According to the review comments, I've also modified the roundtrip process.

Comment thread lua/pl/xml.lua Outdated
@Tieske

Tieske commented Jan 29, 2026

Copy link
Copy Markdown
Member

@yeshan333 so my fix wasn't complete. The pattern is now valid, but not working as designed. Can you please have another look?

Comment thread spec/xml_spec.lua Outdated
@Tieske
Tieske merged commit e7f62e3 into lunarmodules:master Jan 31, 2026
21 checks passed
@Tieske

Tieske commented Jan 31, 2026

Copy link
Copy Markdown
Member

Thx @yeshan333 !

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants