You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cleaner may duplicate enforced attrs with preserve-case input #2476
As a follow-up to #2475, I noticed another small Cleaner issue when working with a parsed Document that preserves attribute case.
If an element already has an attribute that matches an enforced attribute, but with different key case, the cleaned output can contain both versions of the attribute instead of a single enforced one.
The same thing can happen with the standard Safelist.basic() handling of rel="nofollow" on external links.
The intended behavior is that when an enforced attribute applies, the cleaned output should contain that attribute once, using the enforced key and value. A case-variant source attribute should be replaced, not duplicated.
Activity
Canonicalize enforced attrs in Cleaner