From 19cea6b2cdefc02a2feb0d9fed16ff094ed94f9e Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Fri, 15 Mar 2019 15:41:22 -0400 Subject: [PATCH] parser: Rename $lastSection to $lastParagraph This now at least matches the function names even though what's actually meant is more like 'block-level tag'. Section is a poor choice of name since there're wikitext sections unrelated to this. Change-Id: Ic83aff4d862800b778441c28884194480b7e7d96 --- includes/parser/BlockLevelPass.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/parser/BlockLevelPass.php b/includes/parser/BlockLevelPass.php index 25f4b5c9cd..b2bcc8c0a3 100644 --- a/includes/parser/BlockLevelPass.php +++ b/includes/parser/BlockLevelPass.php @@ -25,7 +25,7 @@ class BlockLevelPass { private $DTopen = false; private $inPre = false; - private $lastSection = ''; + private $lastParagraph = ''; private $lineStart; private $text; @@ -65,7 +65,7 @@ class BlockLevelPass { * @return bool */ private function hasOpenParagraph() { - return $this->lastSection !== ''; + return $this->lastParagraph !== ''; } /** @@ -77,13 +77,13 @@ class BlockLevelPass { private function closeParagraph( $atTheEnd = false ) { $result = ''; if ( $this->hasOpenParagraph() ) { - $result = 'lastSection . '>'; + $result = 'lastParagraph . '>'; if ( !$atTheEnd ) { $result .= "\n"; } } $this->inPre = false; - $this->lastSection = ''; + $this->lastParagraph = ''; return $result; } @@ -353,14 +353,14 @@ class BlockLevelPass { $inBlockElem = !$closeMatch; } elseif ( !$inBlockElem && !$this->inPre ) { if ( substr( $t, 0, 1 ) == ' ' - && ( $this->lastSection === 'pre' || trim( $t ) != '' ) + && ( $this->lastParagraph === 'pre' || trim( $t ) != '' ) && !$inBlockquote ) { # pre - if ( $this->lastSection !== 'pre' ) { + if ( $this->lastParagraph !== 'pre' ) { $pendingPTag = false; $output .= $this->closeParagraph() . '
';
-							$this->lastSection = 'pre';
+							$this->lastParagraph = 'pre';
 						}
 						$t = substr( $t, 1 );
 					} elseif ( preg_match( '/^(?:]*>.*?<\\/style>\s*|]*>\s*)+$/iS', $t ) ) {
@@ -376,9 +376,9 @@ class BlockLevelPass {
 							if ( $pendingPTag ) {
 								$output .= $pendingPTag . '
'; $pendingPTag = false; - $this->lastSection = 'p'; + $this->lastParagraph = 'p'; } else { - if ( $this->lastSection !== 'p' ) { + if ( $this->lastParagraph !== 'p' ) { $output .= $this->closeParagraph(); $pendingPTag = '

'; } else { @@ -389,10 +389,10 @@ class BlockLevelPass { if ( $pendingPTag ) { $output .= $pendingPTag; $pendingPTag = false; - $this->lastSection = 'p'; - } elseif ( $this->lastSection !== 'p' ) { + $this->lastParagraph = 'p'; + } elseif ( $this->lastParagraph !== 'p' ) { $output .= $this->closeParagraph() . '

'; - $this->lastSection = 'p'; + $this->lastParagraph = 'p'; } } } -- 2.20.1