-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 text into List Block turns it into a Paragraph block #31067
Comments
Can confirm this is the case. Looks like the logic to convert the plain text that was in the clipboard turns this input in a paragraph, with each line separated with a line break. This in turn gets converted to a I've been looking into how the logic that handles pasting in a RichText component works, and so far, my most elegant solution is adding this snippet in if (
mode === 'AUTO' &&
( tagName === 'ul' || tagName === 'ol' ) &&
pieces.length === 1
) {
return filterInlineHTML( pieces[ 0 ], preserveWhiteSpace );
} Although it fixes the issue we're facing here, I'm not sure this is the best way to approach this though. At this stage, I'm not familiar enough with the ins and out of this part of Gutenberg, but there might be a more elegant solution using the |
I can still replicate this with: WordPress 6.0.1 Twenty Twenty-Two 1.2 |
@ironprogrammer Can confirm that this appears to be fixed now. Thanks. Just tested with WP 6.1.1 (Core only) and also with the Gutenberg (v15.2.4) plugin enabled. I can now paste a list into an actual List block without it converting back to some unwanted block. I'll close this issue. |
Description
When you paste plain text into a List Block it turns into a paragraph block!! Why??
Since you refuse to add a Paste as Text button on blocks, I'm quite often forced to paste text into a plain text editor like BBEdit, to remove the formatting first. When I try and paste text into a List block, it turns it into a Paragraph block. The Paragraph Block offers the ability to transform it back into a List Block. This is just ridiculous! I'm already in a List block, so I obviously want the text pasted as a list. You've shown that you have the ability to change this text into a list by the fact that you have that Transform option. Why can't you automatically transform it when I paste it so I don't have to perform an extra unwanted step of converting it back into the block that I actually wanted in the first place! This is not making WordPress easier to use!
Screen+Recording+2021-04-22+at+02.27.39+pm.mp4
Step-by-step reproduction instructions
Expected behaviour
If I paste text into a List Block, I expect it to remain a List Block
Actual behaviour
It changes into a completely different block that I never wanted to use
Screenshots or screen recording (optional)
See vid above
WordPress information
Device information
The text was updated successfully, but these errors were encountered: