[wp-trac] [WordPress Trac] #64944: Generated Excerpts - Missing white space when stripping <br>s generated in paragraph block, verse block, etc.

WordPress Trac noreply at wordpress.org
Tue Mar 24 18:53:36 UTC 2026


#64944: Generated Excerpts - Missing white space when stripping <br>s generated in
paragraph block, verse block, etc.
--------------------------+------------------------------
 Reporter:  addiestavlo   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  6.9
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by addiestavlo):

 * Attachment "br-spacing-fix.diff" added.

 `<br>` tags are stripped without preserving spacing, causing words to
 concatenate (e.g., ‘thisexample’). This replaces `<br>` with a space
 before tag stripping to preserve word boundaries. Note tags are already
 stripped just after this, and newlines, returns, spaces, etc. are all
 later used to create the $words_array here. This helps retain expected
 generated excerpt behavior when using verse and paragraph (w/ shft+space)
 type blocks.

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


More information about the wp-trac mailing list