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

WordPress Trac noreply at wordpress.org
Tue Apr 23 04:17:00 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.2
Component:  Editor                   |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------

Comment (by azaozz):

 This is somewhat similar to #46133. Ideally the post content should be
 split on `<!--more-->` after the blocks have been parsed. As that's not
 possible, seems the only way to fix this is to treat the `<!-- wp:more ...
 -->` block same as the `<!--more-->` tag: split the post at that place and
 remove the tag and the block.

 Looking at 46471-2.diff, it seems to work properly (I know, parsing
 strings out of HTML with regex is...). Wondering if it would be a bit
 better to do a str_replace() for the block end delimiter. Makes the regex
 a tiny bit simpler and we need to run it only on the first part of the
 split post_content.

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


More information about the wp-trac mailing list