From 84b8ca9801c0e1ad3bcd4c7d6d5d58c26a69d1b7 Mon Sep 17 00:00:00 2001 From: robin Date: Sat, 12 May 2012 23:25:35 +0200 Subject: [PATCH] Remove extra unneeded whitespace This whitespaces causes an extra empty paragraph between text and transcluding a special page. When a heading precedes a transcluded special page, there is no difference and it's fine with or without this whitespace. See for example http://incubator.wikimedia.org/w/index.php?title=Incubator:Sandbox&oldid=822299 Change-Id: I6b06006d921368619d3969660c244176344e8aff --- includes/parser/Parser.php | 4 +--- tests/parser/parserTests.txt | 6 ------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index fa98dbf6a4..35f187f4d8 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3390,10 +3390,8 @@ class Parser { } # Replace raw HTML by a placeholder - # Add a blank line preceding, to prevent it from mucking up - # immediately preceding headings if ( $isHTML ) { - $text = "\n\n" . $this->insertStripItem( $text ); + $text = $this->insertStripItem( $text ); } elseif ( $nowiki && ( $this->ot['html'] || $this->ot['pre'] ) ) { # Escape nowiki-style return values $text = wfEscapeWikiText( $text ); diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index ddb84c3621..3a8a778a70 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -6064,8 +6064,6 @@ Special page transclusion !! input {{Special:Prefixindex/Xyzzyx}} !! result -


-

Xyzzyx
!! end @@ -6077,11 +6075,7 @@ Special page transclusion twice (bug 5021) {{Special:Prefixindex/Xyzzyx}} {{Special:Prefixindex/Xyzzyx}} !! result -


-

Xyzzyx
-


-

Xyzzyx
!! end -- 2.20.1