Skip to content

DomSanitization Support #838

Answered by ghiscoding
gandevijay asked this question in Q&A
Sep 21, 2021 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Angular-Slickgrid (Slickgrid-Universal) uses DOMPurify internally, that is what you should use in a Custom Formatter, you can see it implemented in this TreeFormatter for example.

import * as DOMPurify_ from 'dompurify';
const DOMPurify = DOMPurify_; // patch to fix rollup to work
// ...
const sanitizedOutputValue = DOMPurify.sanitize(outputValue);
return sanitizedOutputValue;

It is recommended to use Custom Formatter instead of Angular Pipe (which would require asyncPostRenderer and are much slower (hence why it's not recommended, better stick with Custom Formatter).

Please consider asking such questions on Stack Overflow when possible.
Thanks ⭐

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@alexartwww
Comment options

@ghiscoding
Comment options

@ghiscoding
Comment options

@ghiscoding
Comment options

Answer selected by ghiscoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants