From 23008e367f0848e782814e861413afc687684b77 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 6 Apr 2008 18:04:38 +0000 Subject: [PATCH] Slight tweak to last commit: don't preserve whitespace if it is actually a heading.\nI'm not actually clear on why we want to introduce this voodoo =-stripping behavior, actually? Do people really enter stuff like "== Section name ==" for their edit summary, and *not* mean it to be saved that way? Why is the expected result to strip the equals signs? And would it make more sense to do the normalization on save as well or also on previews, as we do now? The former is what we do for things like subst. --- includes/EditPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 1468ff86db..3ec0ec009e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -544,7 +544,7 @@ class EditPage { $this->summary = $wgLang->truncate( $request->getText( 'wpSummary' ), 250 ); # Remove extra headings from summaries and new sections. - $this->summary = preg_replace('/^(\s*)=+(.*?)=+(\s*)$/', '$1$2$3', $this->summary); + $this->summary = preg_replace('/^\s*=+\s*(.*?)\s*=+\s*$/', '$1$2$3', $this->summary); $this->edittime = $request->getVal( 'wpEdittime' ); $this->starttime = $request->getVal( 'wpStarttime' ); -- 2.20.1