django-summernote icon indicating copy to clipboard operation
django-summernote copied to clipboard

pasting only raw text to the widget - solution?

Open chicocheco opened this issue 3 years ago • 5 comments

I tried almost any possible solution going through this and nothing worked so far. I need to get raw text from anything you paste to the summernote widget (iframe) so you have to format it only by using displayed icons, because I don't want users to use headers, different fonts or colors. Did anyone manage to make this work? Do I hook a custom function to 'onpaste' event in django templates or in a separate js file and how?

Also I managed to install summernote-cleaner plugin but I didn't like it. its button to remove formatting worked but it broke the widget layout and the function that was suppose to trigger with onpaste event didn't work - all I wanted.

Please, I appreciate any advice. You see that even right here on github you cannot paste anything but raw text - it's just a logical thing to do.

chicocheco avatar Mar 29 '21 18:03 chicocheco

I'm also looking into this, and there just doesn't seem to be a clean solution at this point.

buswedg avatar Dec 20 '21 21:12 buswedg

I'm also looking into this, and there just doesn't seem to be a clean solution at this point.

Well, I gave up on django-summernote and other similar solutions for these reasons and ended up with django-tinymce. You can configure it almost entirely from settings.py to perfection and it looks very clean.

chicocheco avatar Dec 20 '21 21:12 chicocheco

I'm also looking into this, and there just doesn't seem to be a clean solution at this point.

Well, I gave up on django-summernote and other similar solutions for these reasons and ended up with django-tinymce. You can configure it almost entirely from settings.py to perfection and it looks very clean.

Not an option for me unfortunately. I've done a chunk of work to integrate this into an app, so I feel like I'm in 'no turning back' mode. I did find this: https://newbedev.com/paste-content-as-plain-text-in-summernote-editor So, I'm experimenting with a similar implementation via django-summernotes 'js_for_inplace' option. I have seen that execCommand itself is now deprecated. So I'm not even sure this will be a long term solution (if I can get it working).

buswedg avatar Dec 20 '21 21:12 buswedg

This is exactly why I rather put up with the "Powered by TINY" link in the footer of the editor. I wasted a lot of time searching for what I needed. tinymce just works.

chicocheco avatar Dec 20 '21 21:12 chicocheco