[wp-trac] [WordPress Trac] #57830: Block Editor: Revert anchor support for dynamic blocks

WordPress Trac noreply at wordpress.org
Wed Mar 1 14:41:16 UTC 2023


#57830: Block Editor: Revert anchor support for dynamic blocks
-------------------------------------------------+-------------------------
 Reporter:  Mamaduka                             |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.2
Component:  Editor                               |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  gutenberg-merge has-patch has-       |     Focuses:
  testing-info                                   |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  gutenberg-merge has-patch => gutenberg-merge has-patch has-
     testing-info


Comment:

 == Testing Instructions

 === Steps to Reproduce

 * Step 1: Create a new post.
 * Step 2: Switch to the `Code Editor`.
 * Step 3: Insert the following markup into the editor:
 {{{
 <!-- wp:paragraph -->
 <p>Paragraph without anchor</p>
 <!-- /wp:paragraph -->

 <!-- wp:paragraph -->
 <p id="anchor">Paragraph with anchor</p>
 <!-- /wp:paragraph -->

 <!-- wp:heading -->
 <h2>Heading without anchor</h2>
 <!-- /wp:heading -->

 <!-- wp:heading -->
 <h2 id="anchor">Heading with anchor</h2>
 <!-- /wp:heading -->

 <!-- wp:group {"layout":{"type":"constrained"}} -->
 <div id="anchor" class="wp-block-group"></div>
 <!-- /wp:group -->
 }}}
 * Step 4: Publish (or update) the post. 🐞 The markup is changed.

 === Expected Results:
 When testing a patch to validate it works as expected:
 - ✅ The markup should not change.

 When reproducing the bug:
 - The markup is changed to:
 {{{
 <!-- wp:paragraph -->
 <p>Paragraph without anchor</p>
 <!-- /wp:paragraph -->

 <!-- wp:paragraph -->
 <p><p id="anchor">Paragraph with anchor</p></p>
 <!-- /wp:paragraph -->

 <!-- wp:heading -->
 <h2 class="wp-block-heading">Heading without anchor</h2>
 <!-- /wp:heading -->

 <!-- wp:heading {"anchor":"anchor"} -->
 <h2 class="wp-block-heading" id="anchor">Heading with anchor</h2>
 <!-- /wp:heading -->

 <!-- wp:group {"layout":{"type":"constrained"}} /-->
 }}

 Issues:
 * The paragraph block with the anchor are nested in the `p` element
 * A comment about `anchor` attributes has been added to the heading block
 * The anchor in the group block are missing


   **Test Report Icons:**
   🐞 <= Indicates where issue ("bug") occurs.
   ✅ <= Behavior is ''expected''.
   ❌ <= Behavior is ''NOT expected''.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57830#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list