Support TrustedTypes / Sanitization #480
Closed
raphael-inglin-ergon
started this conversation in
Ideas
Replies: 2 comments 8 replies
-
Hi, can you share some ideas here on how you would like to implement it? before raise a PR, typically we don't handle html, prosemirror does don't want to to drag by directly jumping into the PR. you can explore the code and let me know if you still think the implementation is possible? |
Beta Was this translation helpful? Give feedback.
8 replies
-
Fyi, to use trusted types in ngx-editor, the Content-Security-Policy header must have With only
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
For our app, we require trusted types via our CSP policy (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types). Ngx-Editor currently has a few direct assignments to innerHtml without sanitization or trustedTypes, which violates our policy.
I would like to add an optional flag to turn on sanitization (via DOMPurify) for these assignments while keeping the current behavior if not active. This would allow me to use the "dompurify" trusted types and satisfy the policy.
I'd be happy to provide a PR. Any objections or ideas?
Beta Was this translation helpful? Give feedback.
All reactions