-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Find solution for WYSIWYG editor HTML sanitize
- Tried DOMPurify (isomorphic-dompurify) and stumbled that nextjs hydration has error message `window` undefined or other errors. kkomelin/isomorphic-dompurify#228 - Thus still use `dangerouslySetInnerHTML` and do sanitize on server side. This requires something like a directus hook extension: https://github.com/licitdev/directus-extension-sanitize-html There are some issues upstream, so I made my fork version and install it locally (not pushed online yet): - Manually build locally and copy `package.json` and `dist` folder to `directus/extensions/directus-extension-sanitize-html` volume. - The env variables must be sync with directus collection settings, current the collection (e.g., Facts) sanitizes ALL string fields. - Memo some interface setting of WYSIWYG UI, I do this setting for every field, didn't find a way to reuse.
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters