question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not work for me

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
drgrievecommented, Jan 11, 2018

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.

0reactions
ngoclanbaby86commented, Aug 6, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found