Skip to content

Support sanitizing pasted HTML with configurable options #90

@oussamalkd

Description

@oussamalkd

When pasting content from external sources like Microsoft Word or Google Docs, most of the inline formatting/styles are lost in Dragon Editor. Currently, users have to re-style line by line, which creates a poor UX.

It would be very useful if Dragon Editor could:

  • Provide built-in paste sanitization support.
  • Allow passing a sanitizeOptions config to preserve or strip styles (e.g., bold, italic, underline, text-align, colors, etc.).
  • Expose a hook or callback (like onPasteSanitize) so developers can plug in their own sanitizer (e.g. sanitize-html) before inserting the content into the editor.

Right now, we need to implement this manually. Having first-class support in Dragon Editor would make it much easier and standard across projects.

Would love to hear your thoughts 🙏

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions