tafia / quick-xml

Rust high performance xml reader and writer
MIT License
1.18k stars 235 forks source link

Fixes in unescape routine #771

Closed Mingun closed 3 months ago

Mingun commented 3 months ago

This PR fixes 2 errors that I found when working on a new way to represent entity references:

  1. Currently, quick_xml does not allow too long numbers to represent character references. It, however, does not takes in account, that any number of leading zeroes are allowed, so the real character entity length can be any. Conformance test suite contains such tests.
  2. 739 introduced regression where Attribute::unescape_value no longer unescaped predefined entities. That was fixed and checked that no similar places remains

Corresponding test (xmltest\valid\sa\042.xml -- one of):

<!DOCTYPE doc [
<!ELEMENT doc (#PCDATA)>
]>
<doc>&#00000000000000000000000000000000065;</doc>
codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 30.88235% with 47 lines in your changes missing coverage. Please review.

Project coverage is 60.16%. Comparing base (7558577) to head (0315ed0). Report is 59 commits behind head on master.

Files Patch % Lines
src/escape.rs 24.13% 44 Missing :warning:
src/events/attributes.rs 0.00% 3 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #771 +/- ## ========================================== - Coverage 61.81% 60.16% -1.66% ========================================== Files 41 41 Lines 16798 16138 -660 ========================================== - Hits 10384 9709 -675 - Misses 6414 6429 +15 ``` | [Flag](https://app.codecov.io/gh/tafia/quick-xml/pull/771/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/tafia/quick-xml/pull/771/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `60.16% <30.88%> (-1.66%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.