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.

Cleanpaste cleans the already inserted text, not the newly pasted text.

See original GitHub issue

When trying to use the Cleanpaste plugin (which is awesome by the way), the wrong text is cleaned;

So when I paste some text which is not clean (for example it has a style attribute), the style attribute is pasted anyway, so the cleanpaste plugin is not picking it up.

However when I paste something again, next to the already pasted stuff, then the first text is cleaned.

To reproduce:

  1. I copy <p style="color:red;">This goes wrong</p>from a rendered html page. (So you actually see red text)

  2. I paste it in an initialized Trumbowyg editor (Observe it is still red)

  3. I copy <p>Bladibla</p> from a rendered html page

  4. I paste it in the same Trumbowyg editor.

  5. Now the “This goes wrong” text gets cleaned.

I can reproduce this on Ubuntu, in Chrome, Firefox and Opera.

Any suggestions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tveimocommented, Oct 22, 2021

It appears that the cleanpaste plugin no longer works? Tried debugging a bit and this code returns an empty string, not the pasted text / markup:

var clipboardData = (pasteEvent.originalEvent || pasteEvent).clipboardData,
pastedData = clipboardData.getData('Text'),

This is on firefox v93.0. Seem to happen in Chrome as well. Am wondering if it is disabled in the browser due to security concerns with d’n’d?

0reactions
Alex-Dcommented, Nov 22, 2018

Deployed in 2.12.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pasting Clean Text - Word Ribbon Tips
Now, when I want to paste a clean copy of whatever text is in the Clipboard, I simply invoke the shortcut key and...
Read more >
Five Solutions for Pasting Plain Text on a Mac - TidBITS
Quick and Clunky: Run It through a Plaintext Editor. If you already use a plaintext editor like BBEdit, a simple way to strip...
Read more >
Paste plugin | Docs - TinyMCE
This plugin will filter/cleanup content pasted from Microsoft Word. The power of the plugin is in its options, so please take the time...
Read more >
Control the formatting when you paste text - Microsoft Support
Follow these steps to turn it on. Go to File > Options > Advanced. In the Cut, copy, and paste section, select Show...
Read more >
How to Copy and Paste Text Without Any Formatting - Next7 IT
A Clean Paste Every Time. Now you know how to copy and paste without any formatting getting in the way. Sometimes formatting is...
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