-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Word] Image not uploaded when copying full document content #2493
Comments
Hi, @fubar-coder, I've just tested PFO with the provided document and I'm not able to reproduce this issue. The image was uploaded properly (using Word for Office 365, version 1901). Could you give us more information about your development environment or show us your CKEditor 5 config? |
I used the CKEditor 5 demo (classic): https://ckeditor.com/ckeditor-5/demo/ Other than that, I cannot tell you much more except that I used Word 1808. |
Unfortunately, I'm still not able to reproduce your issue - the content is pasted properly in all demos (checked on Windows/Mac in all browsers). Could you record a screencast which shows exact steps to reproduce? Additionally, you can check the console whether there is any error. |
FYI: I used Chrome 71.0.3578.98. EDIT: The problem still exists in version 72.0.3626.96. Firefox works as expected. |
@f1ames, is it possible that the Word version (Word 2016, version 1808) could generate some problems with pasting images? @fubar-coder, could you check whether you can reproduce it in our Paste from Word sample? Also, please open the console to spot any errors. |
The problem is reproducible. I attached the console log. |
Works for me too - Word 16.21 (190117) on Chrome 71.0.3578.98 (macOS). When tested with Paste from Word sample I got so this is something different. Looking at the log attached by @fubar-coder it looks like the image is not correctly transformed into To clarify, @fubar-coder you were able to reproduce the issue on Paste from Word sample with Chrome? What OS do you use? I would like to ask you to try with this codepen sample to see if it works. And then, after pasting, if you could share the content of |
Yes, I can reproduce this problem with the given sample. I use Windows 10, 1809, Build 17763.253. This is the gist which contains two files: one for Chrome (with the error) and one for Firefox (succeeding) https://gist.github.com/fubar-coder/10a04caa0fa4d6fd4da48076f5fb5740 |
Thanks for clarification and sharing output code @fubar-coder! The strange thing is that the output is basically identical for both browsers (apart from the empty line on the beginning which is always added in Firefox) - see the diff https://www.diffchecker.com/u9nwqdkS. At least we know that the issues is not Word clipboard output itself. I assume the case might be that for some reason extracting image RTF data fails in Chrome. One cause may be the fact that extraction function checks for Maybe with particular Windows/Word versions the type is different 🤔 Since we are not able to reproduce it on Windows with the similar setup, I would ask you @fubar-coder for one more thing. Same as before if you could try with this codepen sample and share whole |
Chrome didn't show anything in the "Images RTF". I also created a Gist for "Images RTF" while using Firefox: https://gist.github.com/fubar-coder/7a66caac06db86ed0d5fc7f71ba727bc |
Some additional note: EDIT: Maybe this bug (or a similar one) is back: https://bugs.chromium.org/p/chromium/issues/detail?id=317807 |
Thanks again @fubar-coder.
That's strange TBH and since you are using recent version of the Chrome browser https://bugs.chromium.org/p/chromium/issues/detail?id=317807 should be fixed. Is it possible that you have any active 3rd-party software or a Chrome extensions which may manipulate clipboard contents (you may try to run the sample with all extensions turned off if you have any to check it)? |
Yes, I tried both the "Incognito Window" and also disabled all extensions and restarted the browser, but the problem stays. |
I had the same problem.How did you finally solve it ? |
I see that I can reproduce similar or same issue, when image is located inside a table. In such scenario I couldn't get an image pasted in CKEditor. |
Another case reported - https://github.com/ckeditor/ckeditor5-paste-from-office/issues/60. |
Doesn't work for me too. Maybe it's because MS Word version is 2013. |
@lasfin, can I ask you to provide a sample file which allows you to reproduce the problem? Also, it will be great if you can copy the content from this file, paste it to this codepen sample and share result from I will also confirm this issue as so many people experience it. Unfortunately, it's hard to debug because none of us can reproduce it. |
Finally, I was able to reproduce this issue, however only in our manual tests. My environment:
The scenario which worked for me:
Error:
|
@Mgsy Hello! |
Hi @tuannd255. Unfortunately, we haven't worked on this issue yet, so I'm afraid I can't propose any solution. However, you can add 👍 to the first post to raise the popularity of the issue. |
Windows 7(64bit)Google Chrome 80.0.3987.132Microsoft Office Professional Plus 2013Classic editor5
Not allowed to load local resource: file:///C:/Users/**/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg |
@mlewand I can still reproduce the bug, but I only tested it with the Word document I provided in this issue (initial comment). |
In the case of copying the whole content (including styled headings), the While checking other text editors I noticed that some of them just ignore the image in the content, and some are displaying a warning that some images failed to import. I guess the only solution would be to remove unhandled images from pasted content (so the editor won't throw an error while trying to access local file) and maybe display some notification. This is a different case. In this file there is no |
I don't understand one thing. What does CKEditor 4 do differently that it handles one of the cases well? I mean this: #2493 (comment) It'd be great if you could describe each case in terms of:
|
It's handling that case in the exact same way as CKEditor 5 - notice that in that screenshots one paste includes "A Test" heading and the other does not.
I tested only on 2 computers (a different OS, a different version of Word), and on the other one it worked just ok.
I checked 3 editors and none of them solved it (image is ignored or warning notification appears as mentioned above).
I can't see any reasonable solution (I consider asking users to allow HD access would not be reasonable).
I think that displaying notification would be reasonable. And of course, the editor should not try accessing local files - that also should be fixed. |
Related #8934. |
So this problem has not been solved yet, right? |
Just retested this on macOS Ventura running Chrome and Windows 10 running Firefox and it looks like the issues are no longer reproducible - images are now pasted correctly into our Paste from Word demo. I used the desktop Microsoft Word app on macOS and the Microsoft 365 web app on Windows to handle the original files. |
The image is not uploaded when copying the full contents of the Word document.
When copying only the image with the surrounding paragraphs, the image is uploaded again.
Test Word file:
PasteFromWordTest.docx
EDIT: I used Word 2016 (Office 365 ProPlus), version 1808
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: