I cannot enable the ascii-only lint when my XMIR contains multi-line <comment> elements, because the lint incorrectly flags embedded newlines as non-ASCII violations.
The filter in LtAsciiOnly is:
.filter(chr -> chr < 32 || chr > 127)
The chr < 32 branch catches all ASCII control characters, including newlines (\n = 10), carriage returns (\r = 13), and tabs (\t = 9). But the parser legitimately embeds newlines inside <comment> elements when an EO comment spans multiple lines — those are perfectly valid ASCII characters and should not be reported.
The fix is to drop the chr < 32 half entirely and only flag true non-ASCII characters:
.filter(chr -> chr > 127)
I cannot enable the
ascii-onlylint when my XMIR contains multi-line<comment>elements, because the lint incorrectly flags embedded newlines as non-ASCII violations.The filter in
LtAsciiOnlyis:The
chr < 32branch catches all ASCII control characters, including newlines (\n= 10), carriage returns (\r= 13), and tabs (\t= 9). But the parser legitimately embeds newlines inside<comment>elements when an EO comment spans multiple lines — those are perfectly valid ASCII characters and should not be reported.The fix is to drop the
chr < 32half entirely and only flag true non-ASCII characters: