Git Product home page Git Product logo

Comments (18)

 avatar commented on August 22, 2024 1

@nallwhy created a pull request that looks like it fixes this paste issue. I've tried it on my local machine, and it works fine for me here.

I'll close this issue now, if the problem persists, let me know in a new issue. Cheers guys for bringing this to atttention.

from summernote-cleaner.

 avatar commented on August 22, 2024

hm, will have to check on that, I thought that had been resolved.

from summernote-cleaner.

naimkhalifa avatar naimkhalifa commented on August 22, 2024
  • 1 . I'm facing the same issue.

from summernote-cleaner.

naimkhalifa avatar naimkhalifa commented on August 22, 2024

It seems to happen when summernote-cleaner action setting is set to 'both'. The probleme disappears for me on 'button' only mode.

from summernote-cleaner.

ctf0 avatar ctf0 commented on August 22, 2024

@naimkhalifa because the btn doesnt get triggered on paste

from summernote-cleaner.

naimkhalifa avatar naimkhalifa commented on August 22, 2024

Yeah, I realized it right after I posted but didn't wanted to spam the
issue for nothing :) I guess it's too late.
Thanks for the plugin anyway! It suits my needs.

2016-10-20 15:09 GMT+02:00 Muah [email protected]:

@naimkhalifa https://github.com/naimkhalifa because the btn doesnt get
triggered on paste


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGwKdJqi4db5suKAgFd6SQ1JZC_oRIgSks5q12gEgaJpZM4KVPLt
.

from summernote-cleaner.

dmarklund avatar dmarklund commented on August 22, 2024

I'm facing this issue as well, however, my action is set to "paste" only.
Is there a workaround?

from summernote-cleaner.

ctf0 avatar ctf0 commented on August 22, 2024

@dmarklund the way around is using the btn only

from summernote-cleaner.

dmarklund avatar dmarklund commented on August 22, 2024

@ctf0 such a shame, I don't want the button. I want it to happen automatically whenever a user pastes something into the editor..

I have also tried to manage the copy via the callback myself, and it still makes the original text duplicated.

from summernote-cleaner.

ctf0 avatar ctf0 commented on August 22, 2024

u & me buddy, i had a fix for it quite some time b4 #8 (comment) but @StudioJunkyard used a different implmentation

from summernote-cleaner.

dmarklund avatar dmarklund commented on August 22, 2024

Oh okay. So I guess you haven't gotten it to work as expected? If I do, I'll share my fix.
To be honest, I don't get why Summernote won't implement such a simple function such as this.

from summernote-cleaner.

ctf0 avatar ctf0 commented on August 22, 2024

here is what i was using to fix the issue 6b0fff0 maybe it could help u as a starting point

from summernote-cleaner.

dmarklund avatar dmarklund commented on August 22, 2024

Hello again @ctf0 . I've solved the problem, at least for myself. I wanted to be able to copy & paste content into the editor and strip all HTML from it.

Here's my solution, works great in Chrome, Firefox & Safari (all the latest versions) on Mac.

            // Remove all HTML from the pasted content
            onPaste: function (e) {

                e.preventDefault();
                var pasted = e.originalEvent.clipboardData.getData('Text');

                setTimeout( function(){
                  $('textarea[name="body"]').summernote('editor.insertText', pasted);
                }, 10 );

            }

This should go within the callbacks object of the summernote instance.
You also need to call the editor via jQuery, I didn't find any good way to do it in another way, hence the $('textarea')...

Ps, sorry for the indenting. 🎖

from summernote-cleaner.

ctf0 avatar ctf0 commented on August 22, 2024

no its okay, looks good, but is there anyway to add it to the plugin it self instead of a stand alone ? as this one wont work correctly incase u have multiple text area on the same page

from summernote-cleaner.

dmarklund avatar dmarklund commented on August 22, 2024

I don't know to be honest. I haven't looked at the source at all, just tried out this plugin and it didn't work as expected so I tried to create a solution for myself.

In regards to the multiple text area issue in your case, have you checked if it's parameter for the node that's getting the data pasted into it? I didn't think about that when I fixed it for myself, but that data should be available (E.g, this is related to Summernote and not this plugin).

from summernote-cleaner.

ctf0 avatar ctf0 commented on August 22, 2024

regarding the node, u r calling $('textarea[name="body"]') which is global and so SN will simply paste at any input with that name, and that's why i asked about using the plugin it self which already handle this,

also the main function behind the plugin was to clean MS tags & stuff , not sure if ur solution tackle that as am not that good in JS but to be honest even with the plugin i still have to take care of lots of cleaning on the server side like

<p>something<b/></p>

// or
<p>xyz<span style="line-height: 1.42857;"><br/></span></p>

// or (https://ctf0.wordpress.com/2016/10/01/sanitize-script-tags-before-saving-to-db/)
// specially that SN doesnt handle script tags well
<script>...</script>

// etc...

which is a side effect of this plugin.

about skype , sent u req

from summernote-cleaner.

 avatar commented on August 22, 2024

Hey guys, sorry I've missed these comments, been very busy and away from the computer a lot. Feel free to do a PR, I'm more than happy to add credits for fixes and so on.

I'll have a look into things more over the next few days.

from summernote-cleaner.

ppython avatar ppython commented on August 22, 2024

The PR for reference #15

from summernote-cleaner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.