Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitise all Wysiwyg field type using Keystone after hook #30

Open
ticidesign opened this issue Jun 16, 2020 · 0 comments
Open

Sanitise all Wysiwyg field type using Keystone after hook #30

ticidesign opened this issue Jun 16, 2020 · 0 comments

Comments

@ticidesign
Copy link
Collaborator

ticidesign commented Jun 16, 2020

If the content of the WYSIWYG is stored as HTML the only option I know is to set the inner HTML, dangerously - but obviously with strict limits and sanitation.

Here is a really simple example where I just strip the HTML on the input (expecting markdown)
https://github.com/keystonejs/keystone-jamstack-plus/blob/master/schema/comment.js#L66

NPM package: https://www.npmjs.com/package/sanitize-html

@ticidesign ticidesign created this issue from a note in Muses New Website (To do) Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Muses New Website
  
👟 This Sprint
Development

No branches or pull requests

1 participant