Skip to content

Sanitise all Wysiwyg field type using Keystone after hook #30

Description

@ticidesign

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions