Merge "resourceloader: Simplify load.mock.php by removing includes dependency"
[lhc/web/wiklou.git] / includes / parser / BlockLevelPass.php
index 761d5be..7f78912 100644 (file)
@@ -26,7 +26,7 @@ class BlockLevelPass {
        private $DTopen = false;
        private $inPre = false;
        private $lastSection = '';
-       private $linestart;
+       private $lineStart;
        private $text;
 
        # State constants for the definition list colon extraction
@@ -329,6 +329,14 @@ class BlockLevelPass {
                                                        $this->lastSection = 'pre';
                                                }
                                                $t = substr( $t, 1 );
+                                       } elseif ( preg_match( '/^(?:<style\\b[^>]*>.*?<\\/style>\s*|<link\\b[^>]*>\s*)+$/iS', $t ) ) {
+                                               # T186965: <style> or <link> by itself on a line shouldn't open or close paragraphs.
+                                               # But it should clear $pendingPTag.
+                                               if ( $pendingPTag ) {
+                                                       $output .= $this->closeParagraph();
+                                                       $pendingPTag = false;
+                                                       $this->lastSection = '';
+                                               }
                                        } else {
                                                # paragraph
                                                if ( trim( $t ) === '' ) {