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

Copy-pasting from Google Docs and Sheets does not work on Chrome on Windows #276

Closed
YoranBrondsema opened this issue Dec 22, 2015 · 0 comments

Comments

@YoranBrondsema
Copy link
Collaborator

When copying a simple paragraph from Google Docs on a non-Windows Chrome (in my case Linux), the resulting HTML looks like this:

<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta charset="utf-8"><b style="font-weight:normal;" id="docs-internal-guid-247db770-cad2-1377-b00f-e44a90843b8f"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:14.666666666666666px;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">simple paragraph</span></p></b><br class="Apple-interchange-newline">

This case is handled in mobiledoc-kit. However, when you copy the same thing on the Windows-version of Chrome, you get this:

<html><body><!--StartFragment--><meta charset="utf-8"><b style="font-weight:normal;" id="docs-internal-guid-4efa44e1-cad3-bc28-33bd-d49e8d9e1f3a"><span style="font-size:14.666666666666666px;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">simple paragraph</span></b><!--EndFragment--></body></html>

This causes the DOM parser to fail on the <!--StartFragment--> comment, more specifically in the function normalizeTagName. There it tries to lower-case the tag name of a Node but Comment nodes have no tag name.

A fix is in the make, you can expect a PR very soon!

bantic added a commit to mixonic/content-kit-editor that referenced this issue Jan 5, 2016
@mixonic mixonic mentioned this issue Jan 5, 2016
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

1 participant