fix(description-sanitizer): allow BlockEditor file attachment and callout attributes on div elements#27658
fix(description-sanitizer): allow BlockEditor file attachment and callout attributes on div elements#27658
Conversation
…lout attributes on div elements
2ee519c
|
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
1 similar comment
|
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
Code Review ✅ Approved 3 resolved / 3 findingsUpdates the description sanitizer to allow file attachments and callout attributes on div elements. Sanitization logic for data-url has been tightened, and missing test coverage for block editor attributes has been addressed. ✅ 3 resolved✅ Security: data-url on div lacks protocol validation unlike href on anchor
✅ Quality: Test missing for data-filesize, data-alt, data-callouttype, data-textcontent
✅ Quality: Test coverage for data-textcontent on removed but attr still allowed
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |




Describe your changes:
Extended DescriptionSanitizer to allow BlockEditor-specific data-* attributes on
Attributes added: data-type, data-url, data-filename, data-filesize, data-mimetype, data-uploading, data-upload-progress, data-is-image, data-alt, data-callouttype
Also added data-textcontent to the existing allowlist on tags for entity mention/hashtag nodes
data-temp-file is intentionally excluded as it holds transient upload state that should not be persisted
Fixes #27666
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>