plugin-xml icon indicating copy to clipboard operation
plugin-xml copied to clipboard

Only treat space, `\t`, `\n`, and `\r` as whitespace

Open gebsh opened this issue 2 months ago • 0 comments

This adjusts the RegExp pattern used to trim text while formatting so that it only matches the four characters that are considered whitespace in the XML standard.

I added various invisible characters to the fixture to verify the fix. Please let me know if having them there in an unescaped form is acceptable because they might trigger warnings in some code editors. (Unfortunately, I don't think there's any way to escape them in such a way that the bug is covered by tests.) The full list of non-standard invisible characters that the fixture now contains is:

Fixes #789.

gebsh avatar Nov 01 '25 14:11 gebsh