-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 individual list elements from Firefox on Windows fails #3415
Labels
browser:firefox
The issue can only be reproduced in the Firefox browser.
plugin:clipboard
The plugin which probably causes the issue.
status:confirmed
An issue confirmed by the development team.
type:bug
A bug.
Milestone
Comments
jackwickham
added a commit
to jackwickham/ckeditor-dev
that referenced
this issue
Sep 14, 2019
jackwickham
added a commit
to jackwickham/ckeditor-dev
that referenced
this issue
Sep 14, 2019
I can confirm that the issue is present only in Firefox and only on Windows. |
Comandeer
added
browser:firefox
The issue can only be reproduced in the Firefox browser.
plugin:clipboard
The plugin which probably causes the issue.
labels
Sep 15, 2019
jackwickham
added a commit
to jackwickham/ckeditor-dev
that referenced
this issue
Sep 15, 2019
jackwickham
added a commit
to jackwickham/ckeditor-dev
that referenced
this issue
Sep 15, 2019
jacekbogdanski
added
the
status:confirmed
An issue confirmed by the development team.
label
Sep 17, 2019
2 tasks
It seems to be connected with most basic issue, #3520. |
Comandeer
pushed a commit
to jackwickham/ckeditor-dev
that referenced
this issue
Oct 1, 2019
Comandeer
pushed a commit
to jackwickham/ckeditor-dev
that referenced
this issue
Oct 1, 2019
Closed in #3416. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
browser:firefox
The issue can only be reproduced in the Firefox browser.
plugin:clipboard
The plugin which probably causes the issue.
status:confirmed
An issue confirmed by the development team.
type:bug
A bug.
Type of report
Bug
Provide detailed reproduction steps (if any)
(per https://evercoder.github.io/clipboard-inspector/ as well as dev tool stepping through)
Expected result
The paste succeeds, inserting
Actual result
Root cause
This error appears to be caused because within the clipboard plugin, in
_stripHtml
, the regexes that strip the above snippet trim the<html>
,<body>
and<!--(Start|End)Fragment-->
, but they don't trim the whitespace between<body>
and<!--StartFragment-->
, and between<!--EndFragment-->
and</body>
. The trimmed result therefore has leading and trailing whitespace.When this makes its way to core/editable.js,
processDataForInsertion
, this triggers the leading/trailing whitespace check, so it is prepended and appended with a protection span, so it looks likeThis is then parsed as HTML. As it stands it isn't valid HTML, because there are bare
<li>
s without a<ul>
. When Firefox parses it, it fixes it up as well as it can, to produce HTML equivalent toWhen you then trim the first and last elements of this, to drop the spans that are supposed to be leading and trailing, this deletes everything and causes the rest of the code to break.
Other details
The text was updated successfully, but these errors were encountered: