From 3cd175834be73e34ebfa3327fa2625fc007e07f3 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 1 Feb 2009 18:58:18 +0000 Subject: [PATCH] (bug 14938) Removing a section no longer leaves excess whitespace. Contributed by Michael Walsh. --- CREDITS | 1 + RELEASE-NOTES | 1 + includes/parser/Parser.php | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 9cb284a64f..2c8f12af84 100644 --- 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 diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 14f67792c2..212ac0afec 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 76161b2406..59e0b86a43 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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(); -- 2.20.1