(bug 14938) Removing a section no longer leaves excess whitespace. Contributed by...
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 1 Feb 2009 18:58:18 +0000 (18:58 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 1 Feb 2009 18:58:18 +0000 (18:58 +0000)
CREDITS
RELEASE-NOTES
includes/parser/Parser.php

diff --git a/CREDITS b/CREDITS
index 9cb284a..2c8f12a 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -70,6 +70,7 @@ following names for their contribution to the product.
 * Marooned
 * Max Semenik
 * Michael De La Rue
+* Michael Walsh
 * Mike Horvath
 * Mormegil
 * Nakon
index 14f6779..212ac0a 100644 (file)
@@ -127,6 +127,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 17146) Fix for UTF-8 and short word search for some possible MySQL configs
 * (bug 7480) Internationalize database error message
 * (bug 16555) Number of links to mediawiki.org scaled back on post-installation
+* (bug 14938) Removing a section no longer leaves excess whitespace
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index 76161b2..59e0b86 100644 (file)
@@ -4543,7 +4543,11 @@ class Parser
                        // Output the replacement text
                        // Add two newlines on -- trailing whitespace in $newText is conventionally
                        // stripped by the editor, so we need both newlines to restore the paragraph gap
-                       $outText .= $newText . "\n\n";
+                       // Only add trailing whitespace if there is newText
+                       if($newText != "") {
+                               $outText .= $newText . "\n\n";
+                       }
+
                        while ( $node ) {
                                $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG );
                                $node = $node->getNextSibling();