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

18.4: Pasting code into the HTML block replaces the code with other blocks #61923

Closed
carolinan opened this issue May 24, 2024 · 2 comments
Closed
Labels
[Block] HTML Affects the the HTML Block [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

Description

In Gutenberg 18.4, when you paste code into the HTML block, the HTML block is removed and the content is replaced with other blocks, for example paragraphs or images (depending on the code pasted).

(Typing code still works.)

Reported on trac:
https://core.trac.wordpress.org/ticket/61285

Hello Gutenberg Team,
I hope this message finds you well.
I am writing to report a significant issue I've encountered with the latest version of the Gutenberg plugin (version 18.4). After an unnoticed update to this version, I have found it impossible to insert code into the custom HTML block. When attempting to do so, the block immediately converts the inserted code into paragraphs and text, rendering the functionality of the custom HTML block unusable.
I spent several hours troubleshooting this issue and trying various solutions without success. Eventually, I discovered that deactivating the Gutenberg plugin resolved the problem, and the custom HTML block started working correctly again.
I have also noticed that other users are experiencing the same issue, as reported in the support forums. This appears to be a bug introduced in the latest update and is causing significant disruption to those of us who rely on custom HTML blocks for our websites.
Could you please investigate this issue and provide a fix at the earliest convenience? Your assistance in resolving this matter would be greatly appreciated.
Thank you for your attention to this matter.
Best regards,

Reported on the plugin support forums:
https://wordpress.org/support/topic/18-4-0-stops-you-pasting-text-into-html-block/

Step-by-step reproduction instructions

Copy some HTML source code.

For example

<div class="form-group-header">
    <label required="required" class="d-block mb-1" for="issue_form_21f00f0a3d9c3edf2f85271b07859e799b423029f8d6d0491d5b3fcf1c94471d">Step-by-step reproduction instructions</label>
      <div id="description-21f00f0a3d9c3edf2f85271b07859e799b423029f8d6d0491d5b3fcf1c94471d" data-view-component="true" class="markdown-body note mb-2 text-small">
        <p>Please write the steps needed to reproduce the bug.</p>
</div>  </div>

Create a new post or page.
Insert a HTML block.
Paste the HTML code you copied into the HTML block.

Result:

<!-- wp:paragraph -->
<p>Step-by-step reproduction instructions</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Please write the steps needed to reproduce the bug.</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.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@carolinan carolinan added the [Type] Bug An existing feature does not function as intended label May 24, 2024
@carolinan carolinan changed the title 18:4: Pasting code into the HTML block replaces the code with other blocks 18.4: Pasting code into the HTML block replaces the code with other blocks May 24, 2024
@carolinan carolinan added the [Block] HTML Affects the the HTML Block label May 24, 2024
@liviopv
Copy link

liviopv commented May 24, 2024

somewhat similar to #61377

@carolinan
Copy link
Contributor Author

carolinan commented May 24, 2024

Good find, I was searching specifically for issues related to the HTML block. I will close this issue and work can continue on the linked issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] HTML Affects the the HTML Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants