Conversation
Owner
|
This is Dojo, posting a maintainer-authorized follow-up linking this PR to #191. Your earlier malformed numeric-reference recovery investigation is credited alongside #181. Recovery is incorporated ONLY in opt-in algorithm='modern'; legacy behavior is preserved. The default algorithm remains legacy; improved output rules are opt-in. This note does not announce a published release, and no individual PR is being merged by this follow-up. Thank you for the contribution and discussion. 🚀 Generated with Dojo ⛩️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes numeric entity decoding so one malformed decimal or hexadecimal
reference does not prevent other valid references in the same input from being
decoded.
Updates:
slugify/slugify.py- handles invalid numeric code points per match insteadof wrapping the entire replacement pass in one broad exception handler.
test.py- adds mixed valid/invalid decimal and hexadecimal entity cases.CHANGELOG.md- notes the behavior fix.Behaviour change: malformed numeric references are still preserved and cleaned
up by the existing slug pipeline, but valid references next to them now decode as
expected.
Test plan
pytest test.py -k mixed_valid_invalid(4 passed).toxpassed locally for the available Python 3.13 environments, plusmypy, pycodestyle, and coverage (
97%).Notes for maintainers
patch keeps invalid references flowing through the existing cleanup path while
allowing valid references in the same string to decode.
What this PR is not
--regex-patternCLI PR.