diff options
Diffstat (limited to 'includes/parser/Preprocessor_Hash.php')
-rw-r--r-- | includes/parser/Preprocessor_Hash.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index efad96514454..e37b8a78c5d5 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -149,6 +149,7 @@ class Preprocessor_Hash extends Preprocessor { * @return array JSON-serializable document object model array */ private function buildDomTreeArrayFromText( $text, $flags ) { + $textStartsInSOLState = $flags & self::START_IN_SOL_STATE; $forInclusion = ( $flags & self::DOM_FOR_INCLUSION ); $langConversionDisabled = ( $flags & self::DOM_LANG_CONVERSION_DISABLED ); @@ -606,7 +607,7 @@ class Preprocessor_Hash extends Preprocessor { : strspn( $text, $curChar, $i ); $savedPrefix = ''; - $lineStart = $i > 0 && $text[$i - 1] === "\n"; + $lineStart = ( $i === 0 ) ? $textStartsInSOLState : ( $text[$i - 1] === "\n" ); if ( $curChar === "-{" && $count > $curLen ) { // -{ => {{ transition because rightmost wins |