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

problem copying/pasting rich text & images within a post #53

Open
oferlaor opened this issue Oct 17, 2023 · 9 comments
Open

problem copying/pasting rich text & images within a post #53

oferlaor opened this issue Oct 17, 2023 · 9 comments

Comments

@oferlaor
Copy link

I try to copy and paste text inside posts and it's not working on 2.0.7. I had to revert to a previous version. I didn't note the console error.

Does anyone else see this problem too?

@oferlaor
Copy link
Author

So, 2.0.8 still has this issue. When I copy & paste text and an image from an existing post onto itself, it doesn't work and I get this error:

image

index.js:71 Uncaught (in promise) DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
    at https://htmag.co.il/wp-content/plugins/the-paste/js/admin/mce/the-paste-plugin.js?wp-mce-49110-20201110-tadv-5900:1:10565
    at l (https://htmag.co.il/wp-content/plugins/the-paste/js/admin/mce/the-paste-plugin.js?wp-mce-49110-20201110-tadv-5900:1:2788)
    at s.value (https://htmag.co.il/wp-content/plugins/the-paste/js/admin/mce/the-paste-plugin.js?wp-mce-49110-20201110-tadv-5900:1:2546)
    at Generator.next (https://htmag.co.il/wp-content/plugins/the-paste/js/admin/mce/the-paste-plugin.js?wp-mce-49110-20201110-tadv-5900:1:3143)
    at s (https://htmag.co.il/wp-content/plugins/the-paste/js/admin/mce/the-paste-plugin.js?wp-mce-49110-20201110-tadv-5900:1:8163)
    at n (https://htmag.co.il/wp-content/plugins/the-paste/js/admin/mce/the-paste-plugin.js?wp-mce-49110-20201110-tadv-5900:1:8365)
(anonymous) @ index.js:71
l @ index.js:2
s.value @ index.js:2
(anonymous) @ index.js:2
s @ index.js:2
n @ index.js:2
Promise.then (async)
s @ index.js:2
n @ index.js:2
(anonymous) @ index.js:2
(anonymous) @ index.js:2
r @ index.js:79
value @ index.js:15
(anonymous) @ index.js:241
c.fire @ wp-tinymce.js?ver=49110-20201110:3
fire @ wp-tinymce.js?ver=49110-20201110:3
Pp @ wp-tinymce.js?ver=49110-20201110:3
t @ wp-tinymce.js?ver=49110-20201110:3
C @ wp-tinymce.js?ver=49110-20201110:3
d @ wp-tinymce.js?ver=49110-20201110:3

From what I can see this is the new code for google docs, which thinks it is getting the html from a google docs, but in actuality if it gets the text/html from an editor, it breaks.

One more problem. If I copy from one post to another and I copy text/html - it uploads the image as if it's a new image.

Is there a way to turn on/off the text/html google docs feature? I think it should be opt-in.

@oferlaor oferlaor changed the title problem copying/pasting text problem copying/pasting rich text & images within a post Oct 18, 2023
@oferlaor
Copy link
Author

@mcguffin are you able to reproduce this issue?

@mcguffin
Copy link
Owner

@oferlaor This Button enables/disables the plugin‘s pasting behaviour entierly, so whatever you copy from another post should pasted as-is:
image
(@see #49)

@mcguffin
Copy link
Owner

okay, I got it…

@oferlaor
Copy link
Author

oferlaor commented Oct 19, 2023 via email

@oferlaor
Copy link
Author

IMO, there should be a button to enable/disable google docs and a way to decide the default setting for it. It's far less common to copy/paste from google docs than moving content from one part of the post to another.

@mcguffin
Copy link
Owner

It's not only google docs, there's SVG detection too (if you copy from Adobe XD, Illustrator and alike).
I tend to just skip uploading, if the image URL is on the same domain.

@mcguffin mcguffin reopened this Oct 19, 2023
@oferlaor
Copy link
Author

oferlaor commented Oct 19, 2023 via email

@amccaugh
Copy link

I agree, if anything gets in the way of very common functionality like copying+pasting in the body text, it's a non-starter. I also agree that it would be very helpful if there were a way to set default settings for the plugin -- we have a lot of users on our blog, and I can't guarantee that they're technically savvy and understand how to chagne the settings in their user page.

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