Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pasting HTML fails #1445

Closed
RobAley opened this issue May 4, 2017 · 3 comments
Closed

Pasting HTML fails #1445

RobAley opened this issue May 4, 2017 · 3 comments

Comments

@RobAley
Copy link

RobAley commented May 4, 2017

When manually pasting certain HTML, the paste fails with "TypeError : n.value is not a function" and the pasted HTML remains in the hidden ql-clipboard div. I discovered this when trying to copy in titles (not videos) from beneath videos on Youtube.

Steps for Reproduction

  1. Visit quilljs.com

  2. copy paste the following HTML anywhere into the quill editor on the front page

<h1 class="watch-title-container"><span id="eow-title" class="watch-title" dir="ltr" title="Brian Beckman: Don't fear the Monad">Brian Beckman: Don't fear the Monad</span></h1>

Expected behavior:

The pasted text appears where it is pasted

Actual behavior:

Nothing appears. Inspecting the DOM shows the pasted HTML inside the hidden ql-clipboard div.

Platforms:
Firefox 53.0 on Ubuntu 16.10
Note: It works as expected on Chrome 58.0 on Ubuntu 16.10, so seems Firefox specific

Version:

1.2.4 locally and whatever version is on quilljs.com front page.

@jhchen
Copy link
Member

jhchen commented May 4, 2017

Could be Ubuntu specific too? Firefox on Mac works fine for me.

@RobAley
Copy link
Author

RobAley commented May 5, 2017

I've just tried on Windows 10, and Firefox fails there too (Chrome works fine). I don't have a Mac to test on. To be clear, it's important to have the actual HTML above as what is presented as HTML in the clipboard. So, if you copy and paste the code I provided in my issue direct from your web browser, the HTML that pastes into quill will (at least on Ubuntu and Windows) be the HTML that GitHub uses to display the "HTML", not the HTML itself (and so works fine even in Firefox on Ubuntu). If you first paste it into a text editor and then copy/paste that into quill, there is no alternative GitHub html there, and so it pastes the HTML we intended. Alternatively, copy directly from the title under the video on the youtube page -
https://www.youtube.com/watch?v=ZhuHCtR3xq8

I've disabled all addons in Firefox on Ubuntu and Windows, if someone else has FF on one of those to check it's not something specific to me that would be great!

@benbro
Copy link
Contributor

benbro commented May 7, 2017

I can reproduce by copying it as HTML not as a string:

  1. copy the HTML from the result panel of this CodePen
  2. Paste in the editor https://quilljs.com/

Tested with Firefox 53 on Windows 7
Quill 1.2.4

@jhchen jhchen closed this as completed in e54a07f May 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants