[wp-trac] [WordPress Trac] #46471: Malformed content when using the More block and stripping the teaser

WordPress Trac noreply at wordpress.org
Tue Mar 12 06:26:52 UTC 2019


#46471: Malformed content when using the More block and stripping the teaser
--------------------------+-------------------------
 Reporter:  lukecarbis    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  5.1.2
Component:  General       |    Version:
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-------------------------
 When using `the_content()` and specifying the `$strip_teaser` argument as
 `true`, the output contains a malformed "More" block.

 Steps to reproduce:

 1. In your theme's `single` template, output content using `<?php
 the_content( null, true ); ?>`
 2. Create a a post that includes multiple paragraph blocks, separated by a
 single More block

 The expected output is:
 {{{
 <span id="more-123"></span>

 <p>Second block.</p>
 }}}

 The actual output is:
 {{{
 <span id="more-123"></span>
 <!-- /wp:more -->

 <!-- wp:paragraph -->
 <p>Second block.</p>
 <!-- /wp:paragraph -->
 }}}

 Notice that the closing `<!-- /wp:more -->` tag exists, but the opening
 one doesn't. Additionally, the malformed block tag at the beginning causes
 none of the other block tags to be cleaned up.

 Most importantly, it breaks any dynamic blocks completed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46471>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list