Open ticidesign opened 4 years ago
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
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