Comments (18)
@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.
hm, will have to check on that, I thought that had been resolved.
from summernote-cleaner.
- 1 . I'm facing the same issue.
from summernote-cleaner.
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.
@naimkhalifa because the btn doesnt get triggered on paste
from summernote-cleaner.
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.
I'm facing this issue as well, however, my action is set to "paste" only.
Is there a workaround?
from summernote-cleaner.
@dmarklund the way around is using the btn only
from summernote-cleaner.
@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.
u & me buddy, i had a fix for it quite some time b4 #8 (comment) but @StudioJunkyard used a different implmentation
from summernote-cleaner.
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.
here is what i was using to fix the issue 6b0fff0 maybe it could help u as a starting point
from summernote-cleaner.
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.
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.
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.
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.
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.
The PR for reference #15
from summernote-cleaner.
Related Issues (20)
- Style attributes not stripped when (in html) there are new line characters in the css code HOT 1
- Why 'style' and 'class' attributes still appear when paste from ms word ? HOT 4
- Error with paste with latest master HOT 20
- Pasting HTML from a plaintext context HOT 4
- badTags tagStripper can suffer catastrophic backtracking HOT 10
- Missing returns in cleanHtmlPaste Function
- Publish tags/releases HOT 3
- Limit functions using text rather than HTML length HOT 7
- keepTagContents not working correctly HOT 2
- Using the button in the toolbar seems to paste it before the actual code, therefore duplicating content HOT 4
- JS error when pasting HOT 5
- JS error occur since yesterday HOT 2
- Running into Uncaught TypeError: this.get is not a function when pasting text HOT 8
- keepOnlyTags config is being ignored HOT 1
- [paste] tags aren't removed properly when there are linebreaks between attributes HOT 2
- problem in copy and paste the space HOT 2
- Unable to paste plain text HOT 2
- Feature request: remove tag but keep contents HOT 5
- Cleaner success status text never disappears HOT 1
- chrome words together HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from summernote-cleaner.