Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/78971
Change subject: Indented text in <blockquote> shouldn't create <pre>.
......................................................................
Indented text in <blockquote> shouldn't create <pre>.
This fixes a regression introduced by the fix for bug 6200.
Bug: 52763
Change-Id: If4e1b3a73fb09b559ac98bde4bbd66e49939b7f8
---
M includes/parser/Parser.php
M tests/parser/parserTests.txt
2 files changed, 21 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/71/78971/1
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 4a16f56..e2aa37a 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -154,7 +154,7 @@
*/
var $mStripState;
- var $mIncludeCount, $mArgStack, $mLastSection, $mInPre;
+ var $mIncludeCount, $mArgStack, $mLastSection, $mInPre, $mInBlockQuote;
/**
* @var LinkHolderArray
*/
@@ -289,6 +289,7 @@
$this->mIncludeCount = array();
$this->mArgStack = false;
$this->mInPre = false;
+ $this->mInBlockQuote = false;
$this->mLinkHolders = new LinkHolderArray( $this );
$this->mLinkID = 0;
$this->mRevisionObject = $this->mRevisionTimestamp =
@@ -2416,9 +2417,12 @@
if ( $preOpenMatch and !$preCloseMatch
) {
$this->mInPre = true;
}
+ if ( preg_match(
'/<(\\/?)blockquote[\s>]/i', $t, $bqm ) ) {
+ $this->mInBlockQuote = !$bqm[1];
+ }
$inBlockElem = !$closematch;
} elseif ( !$inBlockElem && !$this->mInPre ) {
- if ( ' ' == substr( $t, 0, 1 ) and (
$this->mLastSection === 'pre' || trim( $t ) != '' ) ) {
+ if ( ' ' == substr( $t, 0, 1 ) and (
$this->mLastSection === 'pre' || trim( $t ) != '' ) and !$this->mInBlockQuote )
{
# pre
if ( $this->mLastSection !==
'pre' ) {
$paragraphStack = false;
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 41d49d1..e081bd2 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -1353,15 +1353,15 @@
!! end
!! test
-Bug 6200: Preformatted in <blockquote>
+Bug 52763: Preformatted in <blockquote>
!! input
<blockquote>
Blah
</blockquote>
!! result
<blockquote>
-<pre>Blah
-</pre>
+<p> Blah
+</p>
</blockquote>
!! end
@@ -1900,6 +1900,12 @@
foo
</blockquote>
+<blockquote>
+<pre>
+foo
+</pre>
+</blockquote>
+
<table><tr><td>
foo
</td></tr></table>
@@ -1921,7 +1927,12 @@
</pre>
</center>
<blockquote>
-<pre>foo
+<p> foo
+</p>
+</blockquote>
+<blockquote>
+<pre>
+foo
</pre>
</blockquote>
<table><tr><td>
--
To view, visit https://gerrit.wikimedia.org/r/78971
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If4e1b3a73fb09b559ac98bde4bbd66e49939b7f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits