-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Remove wrapper from image raw transform; Added test cases; #4740
Conversation
Nice work, this will be a good fix to have in. It works for me! 👍 👍 |
@@ -18,6 +18,8 @@ const types = [ | |||
'google-docs', | |||
'ms-word', | |||
'ms-word-online', | |||
'one-image', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any point in adding a test for one image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I like tests for single and multiple values. So if the two images test fails, we can check if the single one passed if yes, we know it is problem affecting just the multiple case logic. If the single case also fails we know that it is a problem affecting the transform in general.
Pasting aligned content from the old editor no longer works since it is wrapped in a paragraph. #4660 would fix that though. |
Hi @iseulde,
I'm not being able to replicate that problem. I tried with the following content
And the images were pasted as expected, the alignment was not right but I think it is not related it this changes. Do you have a sample where this fix is failing so I can look further :)? |
ed44733
to
773f27c
Compare
@jorgefilipecosta I meant aligned images, not aligned text. :) |
Hi @iseulde, sorry I did explain the code block. What I wanted to mean is that it looks like there are two ways classic editor may align images.
And using a class:
I tried to handle both formats and both of them worked. So I'm having troubles replicating the problem when pasting aligned content from the old editor. |
Do you copy from the visual editor? It has paragraphs added. Here's debug info:
The classes are there, but the new code doesn't catch it. If we merge #4660 first though, there is no need to account for it anymore though. There won't be any images wrapped in a paragraph tag then. |
@jorgefilipecosta I think this is good after a rebase with #4660. It will fix the issue above. While pasting multiple images now works in master, this change is still a good one because there is no longer the case where an image can be wrapped in a paragraph. |
The url of the first image was used in all the other images, html copy past operations, and when using covert to blocks option.
773f27c
to
a40e4eb
Compare
Thank you @iseulde it was merged :) |
With the latest code changes the wrapper in the image raw transform is no longer required. Added integration tests cases to make sure we don't regress on image raw handling and existing bugs don't come back. Previous bugs affecting the functionality: #4694, #4449
How Has This Been Tested?
Past multiple images in a post, verify the correct URLs are used.
Create a block with multiple images in the classic editor, use the convert to blocks option work as expected.