Relatedly, add parseInline function to OutputPage, to avoid duplicating the same awful regex in wfMsgExt.
return $parserOutput->getText();
}
+ /** Parse wikitext, strip paragraphs, and return the HTML. */
+ public function parseInline( $text, $linestart = true, $interface = false ) {
+ $parsed = $this->parse( $text, $linestart, $interface );
+
+ $m = array();
+ if ( preg_match( '/^<p>(.*)\n?<\/p>\n?/sU', $parsed, $m ) ) {
+ $parsed = $m[1];
+ }
+
+ return $parsed;
+ }
+
/**
* @param Article $article
* @param User $user