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

Custom HTML block transforms into different block when pasting the code #91097

Closed
devNigel opened this issue May 24, 2024 · 21 comments
Closed

Custom HTML block transforms into different block when pasting the code #91097

devNigel opened this issue May 24, 2024 · 21 comments
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] Core Blocks Blocks that come with Gutenberg. [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Feature] Post/Page Editor The editor for editing posts and pages. [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. [Platform] Atomic [Platform] Simple [Pri] High [Product] WordPress.com All features accessible on and related to WordPress.com. [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts Triaged To be used when issues have been triaged. [Type] Bug

Comments

@devNigel
Copy link

Quick summary

Pasting HTML codes into a Custom HTML block automatically transforms it into another block. This appears to be a new feature but results in a bad user experience as it removes the essential parts of the code and makes it difficult to edit the code added to the Custom HTML block.

For example, if you paste HTML code for Image, it immediately transforms into an Image block.

If you add code for Iframe embed, it turns into an Embed block.

If you add a JavaScript widget with HTML, it turns into a Paragraph block.

This behavior is reproducible on both Atomic and Simple sites.

Steps to reproduce

  1. On a page or post editor, click on + icon and add Custom HTML block.
  2. Copy a HTML / JavaScript code and paste it into the Custom HTML block. For example, you can use code for the embeddable clock widget from here: https://logwork.com/clock-widget-text
  3. Observe that the Custom HTML block automatically transforms into a Paragraph block.

Here's a screen recording:
https://github.com/Automattic/wp-calypso/assets/33957570/6dbbc6c4-3195-43f5-9946-ca9b725b45ce

This is how it renders on the live page:

image

What you expected to happen

Custom HTML block should remain in their original state instead of transforming automatically.

What actually happened

Custom HTML block automatically transformed to Paragraph block.

Impact

All

Available workarounds?

Yes, difficult to implement

Platform (Simple and/or Atomic)

Simple, Atomic

Logs or notes

Workaround is to add Custom HTML block, switch to Code Editor view and paste the code between

Screen recording:
https://github.com/Automattic/wp-calypso/assets/33957570/0fba8a41-03d6-4b72-af61-0d4d5c630e09

This makes the code work as expected:

image
@devNigel devNigel added [Type] Bug [Feature] Post/Page Editor The editor for editing posts and pages. Needs triage Ticket needs to be triaged [Product] WordPress.com All features accessible on and related to WordPress.com. [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. labels May 24, 2024
@github-actions github-actions bot added the [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts label May 24, 2024
@devNigel
Copy link
Author

User report: 8231362-zd-a8c

Copy link

github-actions bot commented May 24, 2024

Support References

This comment is automatically generated. Please do not edit it.

  • 8231362-zen
  • 8231919-zen
  • 8232265-zen
  • 8232215-zen
  • 8232784-zen
  • 8231661-zen
  • 8235170-zen
  • 8234931-zen
  • 8235178-zen
  • 8236654-zen
  • 8234797-zen
  • 8235648-zen
  • 8237160-zen
  • 8238862-zen
  • 8196112-zen
  • 8237502-zen
  • 8235898-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label May 24, 2024
@vinnykaur
Copy link

I have got two reports so far. 8231919-zen and 8232265-zen

@jartes
Copy link
Contributor

jartes commented May 24, 2024

Another report on 8232215-zd-a8c

@alevarsir
Copy link

Another report: 8232784-zen

@mrfoxtalbot
Copy link

This is coming from core WordPress/gutenberg#61923

@lupus2k lupus2k closed this as completed May 24, 2024
@lupus2k lupus2k reopened this May 24, 2024
@liviopv
Copy link

liviopv commented May 24, 2024

📌 REPRODUCTION RESULTS

  • Tested on Simple – Replicated
  • Tested on Atomic – Replicated
  • Replicable outside of Dotcom – Yes

📌 FINDINGS/SCREENSHOTS/VIDEO

It the example below (Atomic), it switches the Custom HTML block into a Code Block
https://github.com/Automattic/wp-calypso/assets/14153300/074f460f-e522-4195-92bd-9d6af4702ab4

📌 ACTIONS

📌 WORKAROUND

  1. Add the Custom HTML Block
  2. Switch from Visual Editor to Code Editor
  3. Add the HTML code inside the markup for the block:

CleanShot 2024-05-24 at 11 12 23@2x

@liviopv liviopv added [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. Triaged To be used when issues have been triaged. [Feature] Core Blocks Blocks that come with Gutenberg. and removed Needs triage Ticket needs to be triaged labels May 24, 2024
@mrfoxtalbot
Copy link

Another one in zen-8232975

@marcuswisecaesar
Copy link

Another one in 8231661-zen

@supernovia
Copy link
Contributor

supernovia commented May 24, 2024

Another one from the forums: 8235170-zd-a8c

This user would like an update once this is resolved.

@jamiepalatnik
Copy link

Another report: 8234931-zd-a8c
I let user know we'll follow up with an update. I shared the workaround to switch to the Code Editor view in the meantime.

@mosesmed
Copy link

8235178-zen

@vinnykaur
Copy link

8236654-zen

@Aurorum
Copy link
Contributor

Aurorum commented May 25, 2024

8234797-zen - advising that they use a Shortcode

@github-actions github-actions bot added the [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. label May 25, 2024
@Aurorum
Copy link
Contributor

Aurorum commented May 25, 2024

8235648-zen

@vinnykaur
Copy link

8237160-zen

@rinazrina
Copy link

Another one: 8238862-zd-a8c

@i11za
Copy link

i11za commented May 26, 2024

Another user report, shared the workaround: 8196112-zd-a8c

@daria2303
Copy link

8237502-zd-a8c

@mrfoxtalbot
Copy link

Another one in 8235898-zd-a8c

via this comment #91139 (comment)

@mrfoxtalbot
Copy link

This has been fixed via WordPress/gutenberg#61389

Updating to 18.4.1 should fix the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] Core Blocks Blocks that come with Gutenberg. [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Feature] Post/Page Editor The editor for editing posts and pages. [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. [Platform] Atomic [Platform] Simple [Pri] High [Product] WordPress.com All features accessible on and related to WordPress.com. [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts Triaged To be used when issues have been triaged. [Type] Bug
Development

No branches or pull requests