On 02/05/2014 08:46 AM, bawolff wrote:
Not really. Even innternally in core (in OutputPage
and in Message
class) we regex out the <p> when its not wanted. (Icky!)
Better late than
never, I did want to say thank you for the answer.
$ rgrep "preg_match( '/^<p>" . -A2
./includes/Message.php: if ( preg_match(
'/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
./includes/Message.php- $string = $m[1];
./includes/Message.php- }
--
./includes/OutputPage.php: if ( preg_match(
'/^<p>(.*)\n?<\/p>\n?/sU', $parsed, $m ) ) {
./includes/OutputPage.php- $parsed = $m[1];
./includes/OutputPage.php- }
--
./includes/GlobalFunctions.php: if ( preg_match(
'/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
./includes/GlobalFunctions.php- $string = $m[1];
./includes/GlobalFunctions.php- }
At the very least, I call [[Rule of three (computer programming]] on
that! It would be nice to have an option where the superfluous <p>
didn't show up in the first place, but short of such niceness, the
common functionality at least needs to be factored out.
Would filing a bug report be the appropriate thing for me to do with
this suggestion?
-Zach