Use <div> wrappers instead of <p> in ProtectionForm
authorC. Scott Ananian <cscott@cscott.net>
Thu, 27 Sep 2018 15:44:15 +0000 (11:44 -0400)
committerC. Scott Ananian <cscott@cscott.net>
Thu, 27 Sep 2018 15:44:15 +0000 (11:44 -0400)
<p>-wrappers are fragile in case the wrapped content contains `<div>`,
`<p>` (or wikitext double newlines).  Use <div> wrappers consistently
in MediaWiki.

Bug: T205624
Change-Id: Ieee77f4220c7895ac5dccb2b638baef0dc22c84f

includes/ProtectionForm.php

index 1f3de50..eacd370 100644 (file)
@@ -204,9 +204,9 @@ class ProtectionForm {
                $out->addBacklinkSubtitle( $this->mTitle );
 
                if ( is_array( $err ) ) {
-                       $out->wrapWikiMsg( "<p class='error'>\n$1\n</p>\n", $err );
+                       $out->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n", $err );
                } elseif ( is_string( $err ) ) {
-                       $out->addHTML( "<p class='error'>{$err}</p>\n" );
+                       $out->addHTML( "<div class='error'>{$err}</div>\n" );
                }
 
                if ( $this->mTitle->getRestrictionTypes() === [] ) {