DomSanitization Support #838
-
Does the current version of the Angular-Slickgrid supports the DomSanitizatoin? If yes please help me how to do it. Requirement: From the API call I get the rich text as data which has html elements in it. Need to display the rich text into the grid as is to have the formatting e.g. bold, underline. Here is a similar ask from another person. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
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. |
Beta Was this translation helpful? Give feedback.
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.
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 ⭐