Make WordPress Core

Changeset 63665


Ignore:
Timestamp:
09/17/2026 05:34:13 PM (2 months ago)
Author:
adamsilverstein
Message:

Formatting: Prevent wpautop() moving a paragraph into an attribute of a blockquote.

Props johnbillion, westonruter, jonsurrell, joehoyle, dmsnell, xknown, jorbin, jeremyfelt, rafiem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r63540 r63665  
    561561
    562562        // If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.
    563         $text = preg_replace( '|<p><blockquote([^>]*)>|i', '<blockquote$1><p>', $text );
     563        $text = preg_replace( '!<p><blockquote((?:[^>"\']|"[^"]*"|\'[^\']*\')*)>!i', '<blockquote$1><p>', $text );
    564564        $text = str_replace( '</blockquote></p>', '</p></blockquote>', $text );
    565565
Note: See TracChangeset for help on using the changeset viewer.