From f634c7934710975d63934c941d72eb230f2dc7b5 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 6 Apr 2008 17:58:21 +0000 Subject: [PATCH] Partial revert of r32376: don't strip whitespace from summaries. If you do, that means that the default "/* Section name */ " summary loses its trailing space if you hit preview before submitting, which is noticeably inconsistent and annoying. Maybe trim it on save, but I don't know if there's any point. --- includes/EditPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 99f1f76c2b..1468ff86db 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -543,8 +543,8 @@ class EditPage { # Truncate for whole multibyte characters. +5 bytes for ellipsis $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 250 ); - # Remove extra headings and whitespace from summaries and new sections. - $this->summary = trim(preg_replace('/^=+(.*?)=+$/', '$1', trim($this->summary))); + # Remove extra headings from summaries and new sections. + $this->summary = preg_replace('/^(\s*)=+(.*?)=+(\s*)$/', '$1$2$3', $this->summary); $this->edittime = $request->getVal( 'wpEdittime' ); $this->starttime = $request->getVal( 'wpStarttime' ); -- 2.20.1