-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Labels
untriagedBug reports that haven't been triagedBug reports that haven't been triaged
Milestone
Description
Describe the bug
linkify on a string with entities inside anchor element text results in the & character of the entity being incorrect escaped to &
e.g. ->  
** python and bleach versions (please complete the following information):**
- Python Version: 3.9.5
- Bleach Version: 6.0.0
To Reproduce
A simple test to reproduce the behavior:
>>> from bleach import linkify
text = r'<p><a href="/">Some entity’s</a>More entity’s</p>'
expected = r'<p><a href="/" rel="nofollow">Some entity’s</a>More entity’s</p>'
assert linkify(text) == expected Expected behavior
linkify(r'<a href="/">Some entity’s</a>')
'<a href="/" rel="nofollow">Some entity’s</a>'Actual behavior
linkify(r'<a href="/">Some entity’s</a>')
'<a href="/" rel="nofollow">Some&nbsp;entity&rsquo;s</a>'Additional context
This bug was introduced in 6.0.0 with the fix for #501 and #692: #692
Metadata
Metadata
Assignees
Labels
untriagedBug reports that haven't been triagedBug reports that haven't been triaged