Open nbcsteveb opened 1 month ago
I wasn't able to reproduce the exact same issue. For me, the block is show as invalid straight away (step 2) and I don't see extra paragraphs. It might be a difference in configuration. I don't think the paragraph knows how to handle the dir
attribute, so that's why I get a validation issue.
If I use markup that I created in the editor using the 'Language' format I'm not seeing any issues:
wp_insert_post( array( 'post_content' => '<!-- wp:paragraph --><p><bdo lang="" dir="ltr">Hello, world!</bdo></p><!-- /wp:paragraph -->' ) );
I also tested on WordPress 6.6.1, and it wasn't reproduced. Likewise, I could not proceed to Step 2.
At the same time, I tried the suggested code adding lang
attribute and it worked fine.
wp_insert_post( array( 'post_content' => '<!-- wp:paragraph --><p><bdo lang="" dir="ltr">Hello, world!</bdo></p><!-- /wp:paragraph -->' ) );
Some assumptions might be different, but I wasn't able to reproduce too.
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
Description
If I save an article such as:
When you open the article and save as draft, this function (or something around it) is updating this content to:
Which Gutenberg then tells the user is an invalid block of content:
And when resolving:
Step-by-step reproduction instructions
wp_insert_post(['post_content'=>'<!-- wp:paragraph --><p dir="ltr">Hello, world!</p><! -- /wp:paragraph -->']);
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.