Does not work for me
See original GitHub issueI executed as in the example in the readme and it did not work correctly, of every form and configuration that I use it always removes all the elements when I am going to paste a content.
I put keepHtml to true and even then the tags defined in keepOnlyTags are removed when pasting content.
I am using version 0.8.7 with webpack.
require('summernote');
require('summernote-cleaner')
$('.summernote').summernote({
toolbar: [
['style', ['bold', 'italic', 'underline']],
['misc', ['undo','redo','fullscreen']],
],
disableDragAndDrop: true,
disableResizeEditor: true,
cleaner:{
notTime: 2400,
action: 'paste',
newline: '<br>',
notStyle: 'position:absolute;top:0;left:0;right:0',
keepHtml: true,
keepOnlyTags: ['<p>', '<br>', '<ul>', '<li>', '<b>', '<strong>','<i>', '<a>'],
keepClasses: false,
badTags: ['table','style', 'script', 'applet', 'embed', 'noframes', 'noscript', 'html'],
badAttributes: ['style', 'start']
}
});
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
What is the difference between "it doesn't work for ... - HiNative
(2) It doesn't work for me means 1. a particular method/way of doing something does not work for the person 2. something is...
Read more >“That doesn't work for me.”. A How to Guide on Being Assertive
In a world full of people pleasing, being assertive is a needed trait. It forces you to strike the perfect balance.
Read more >It doesn't work for me - WordReference Forums
It means that talking to ten different people about the same things is unacceptable to him, Kohlridg. This is nothing that he wants...
Read more >it doesn't work to me or it doesn't work for me? - TextRanch
It doesn't work for me to go on with this thing, with such a wide gulf between those who understand, love and are...
Read more >"This doesn't work for me" is the biggest mistake you'll make
Mindset matters in your small business. Learn how this simple statement "this doesn't work for me" can cripple your business, and what to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve had quick look. I was able to get some html parsed by changing:
var text = e.originalEvent.clipboardData.getData(options.cleaner.keepHtml ? ‘Text’ : ‘text/plain’); to
var text = e.originalEvent.clipboardData.getData(options.cleaner.keepHtml ? ‘text/html’ : ‘text/plain’);
and removing html from the bad tags.
Fairly sure the above won’t work for plain text so would need more coding.
Same issue, it’s not working fine.
keepHtml: true, // Remove all Html formats keepOnlyTags: ['<p>', '<br>', '<ul>', '<li>', '<b>', '<strong>','<i>', '<a>'],
But it remove all tag. and
newline: '<br>',
same default setting of summernote, not have any changed.