Clear text formatting when pasting in summernote

Hello,

I have a page where I have multiple summernote editors (up to 8). I’d like, for all and any of them, that when users paste text, all formating is cleared. It seems possible according to https://stackoverflow.com/questions/30993836/paste-content-as-plain-text-in-summernote-editor .

Would someone have guidance on how could this code be applied to my use case, with a set of multiple editors?

Thanks!

This: https://github.com/DiemenDesign/summernote-cleaner looks really interesting, but I was unable to make it work within wappler (some features like the word counting work, but not the paste cleaner).

@patrick, @George, @Teodor, maybe this could be in the books for a future update? I’m sure a lot of use cases would benefit from it, unless you can give a quick workaround to integrate this with a small hack…

1 Like

Bump.

A way of pasting plain text would be really useful (maybe as an option from the browser component, like the current paste from clipboard, so it could be assigned to a keyboard combination as well as being used outside of Summernote?)

Converted to FR as seems more suitable.

Hi Ben @bpj,

There was an integration follow-up here: Summernote-cleaner integration? .
However, that script proved to be rather poor.

Thanks Nathaniel,
I’m giving it a go to see whether it will do what I need. Just can’t seem to get the cleaner to initiate, setting the global ‘editorConfig’ doesn’t seem to work. How did you achieve it?

I know this isn’t the best way ever, but I always just paste to the old trusty notepad.exe and then recopy the text from there. Bam. Text cleaned.

Thanks @baub, it’s not about me pasting. I know the shortcuts on Mac to do it. It’s about users who are copying from Word etc. and trimming out as much MS rubbish as possible.

There is the strip tags formatter? Yank out any formatting text from the data first? Maybe have a button that says remove formatting and then redacts the input without any formatting tags?

1 Like

Unfortunately that doesn’t work on paste and I don’t want all tags from the rest of the input to be removed as that could remove formatting, images etc. added through Summernote So can’t do it on update.

I’m making progress with the Summernote cleaner but it needs some adjustments :pensive:

doesn’t it always? LOL. Good luck, let us know how it turns out.