Skip to content

Conversation

@karfau
Copy link
Member

@karfau karfau commented Nov 25, 2024

I was misled by some test cases from xmltest.zip,
to think that xml containing the Unicode replacement character should be treated as not well-formed. This is now fixed by lowering the error level from fatalError which can not be ignored, to warning which can be ignored.
It can also be treated as an exit condition by using onWarningStopParsing as the error handler, which is recommended if you do not need to be lax about the content being parsed.

fixes #790

I was misled by some test cases from xmltest.zip,
to think that xml containing the Unicode replacement character should be treated as not well-formed.
This is now fixed by lowering the error level from `fatalError` which can not be ignored,
to `warning` which can be ignored.
It can also be treated as an exit condition by using `onWarningStopParsing` as the error handler,
which is recommended if you do not need to be lax about the content being parsed.

fixes #790
@karfau karfau added this to the 0.9.6 milestone Nov 25, 2024
@socket-security
Copy link

socket-security bot commented Nov 25, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] None 0 149 kB karfau

🚮 Removed packages: npm/[email protected]

View full report↗︎

@codecov
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.05%. Comparing base (6e44838) to head (cfbd45a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #794   +/-   ##
=======================================
  Coverage   95.05%   95.05%           
=======================================
  Files           8        8           
  Lines        2165     2165           
  Branches      569      569           
=======================================
  Hits         2058     2058           
  Misses        107      107           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@karfau karfau merged commit 1dab19d into master Nov 26, 2024
38 checks passed
@karfau karfau deleted the unicode-replacement-char-warning branch November 26, 2024 04:22
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

Successfully merging this pull request may close these issues.

How to ignore error for the Unicode replacement character?

1 participant