if ( $openMatch || $closeMatch ) {
$pendingPTag = false;
- # @todo T7718: paragraph closed
- $output .= $this->closeParagraph();
+ // Only close the paragraph if we're not inside a <pre> tag, or if
+ // that <pre> tag has just been opened
+ if ( !$this->inPre || $preOpenMatch ) {
+ // @todo T7718: paragraph closed
+ $output .= $this->closeParagraph();
+ }
if ( $preOpenMatch && !$preCloseMatch ) {
$this->inPre = true;
}
<p>this is a <b>test</b></p>
!! end
+!! test
+Parser hook: horizontal rule inside extension tag that outputs <pre>
+!! wikitext
+<tag>
+Hello
+<hr/>
+Goodbye
+</tag>
+!! html/php
+<pre>
+'
+Hello
+<hr/>
+Goodbye
+'
+array (
+)
+</pre>
+
+!! end
+
###
### (see tests/parser/parserTestsParserHook.php for the <statictag> extension)
###