Reusable shared utility package for sanitize html functionality - #34933
Reusable shared utility package for sanitize html functionality#34933rbondesson wants to merge 19 commits into
Conversation
| // rather than applying the message MXC-only transform. | ||
| "img", | ||
| // Disable the default transformer as it forbids inline styles | ||
| // Embedded pages intentionally retain inline styles. |
There was a problem hiding this comment.
Comment changes look a bit odd?
There was a problem hiding this comment.
Since the objectExluding was redundant the comments have been moved and updated. Better now?
| "img": (tagName: string, attribs: HtmlSanitizeAttributes) => ({ tagName, attribs }), | ||
| "*": (tagName: string, attribs: HtmlSanitizeAttributes) => ({ tagName, attribs }), |
There was a problem hiding this comment.
Why do we have the objectExcluding call above if we just overwrite them anyway?
There was a problem hiding this comment.
Removed the redundant objectExcluding and updated the comments.
There was a problem hiding this comment.
Why was this change necessary at all, why did objectExcluding not work?
There was a problem hiding this comment.
The extracted shared sanitizer now has resctrictive defaults, compared to before. Using objectExcluding would now mean “use shared defaults,” not “disable transforms” as it did before. Added a comment about it.
…ement-web into feature/shared-utils
Checklist
public/exportedsymbols have accurate TSDoc documentation.Summary
Implements a shared utility package, https://github.com/element-hq/integrations-internal/issues/76
Changes