* (bug 2785) Accept optional colon prefix in links when formatting comments
* Don't show "you can view and copy the source of this page" message for
pages which don't exist
+* (bug 8310) Blank line added to top of 'post' when page is blank
== Languages updated ==
}
$oldtext = $rev->getText();
- if($section=='new') {
- if($summary) $subject="== {$summary} ==\n\n";
- $text=$oldtext."\n\n".$subject.$text;
+ if( $section == 'new' ) {
+ # Inserting a new section
+ $subject = $summary ? "== {$summary} ==\n\n" : '';
+ $text = strlen( trim( $oldtext ) ) > 0
+ ? "{$oldtext}\n\n{$subject}{$text}"
+ : "{$oldtext}{$subject}{$text}";
} else {
+ # Replacing an existing section; roll out the big guns
global $wgParser;
$text = $wgParser->replaceSection( $oldtext, $section, $text );
}
+
}
wfProfileOut( __METHOD__ );