quill icon indicating copy to clipboard operation
quill copied to clipboard

Quill 2.0 clipboard matcher issue

Open volser opened this issue 6 years ago • 5 comments

When paste plain text, clipboard matchers are not applied. because of this line

https://github.com/quilljs/quill/blob/develop/modules/clipboard.js#L87 new quill just interrupts converting delta

I believe need to apply all textMatchers in this case

Steps for Reproduction

  1. visit https://codepen.io/volser/pen/pMxBOX
  2. Paste text from plain text editor

https://recordit.co/nOvfaaJpKF

Expected behavior: Clipboard handler should be called

Actual behavior: Was not called

Platforms: Windows, Chrome

Version: "2.0.0-dev.2"

volser avatar Jul 31 '19 08:07 volser

@jhchen added description as you wanted

volser avatar Aug 12 '19 08:08 volser

Confirming I've come up against this too.

These lines are a short-circuit of the matcher functionality for text that doesn't include HTML:

The following line calls convertHTML which in turn calls traverse which actually applies the matchers

This is easily reproduced by:

  • copying plain text from a text editor / browser console and pasting (no matchers fired)
  • copying any text from a website or out of the quill editor itself and pasting (matchers fired)

The text copied from an html source will at minimum include a <meta charset> tag whereas plaintext does not, see the difference below (first result plaintext, second copied from html source)

image

bradbarrow avatar Mar 09 '22 03:03 bradbarrow

Still appears to be a regression, even in the latest 2.0.0-dev.4.

gordoncl avatar Mar 15 '22 01:03 gordoncl