jenkins-bot has submitted this change and it was merged.

Change subject: [Regression] Do not trim spaces on edit preview or show changes
......................................................................


[Regression] Do not trim spaces on edit preview or show changes

Since Ic05e5898 spaces are also trimmed on preview/show changes, which
is bad, because the autosummary "/* Header */ " gets trimmed and the
user text is direct written behind the slash. That is confusing and was
not so, before this change.

Force the trim on summary preview to have the right preview, because the
spaces are trimmed on save.

Change-Id: I0058ce31197f3ea8ffc5520f3f0f9e1bf6105066
---
M includes/EditPage.php
1 file changed, 3 insertions(+), 4 deletions(-)

Approvals:
  IAlex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/EditPage.php b/includes/EditPage.php
index 4e3ea49..5434dab 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -624,11 +624,8 @@
                                wfProfileOut( get_class( $this ) . 
"::importContentFormData" );
                        }
 
-                       # Trim spaces on user supplied text
-                       $summary = trim( $request->getText( 'wpSummary' ) );
-
                        # Truncate for whole multibyte characters
-                       $this->summary = $wgContLang->truncate( $summary, 255 );
+                       $this->summary = $wgContLang->truncate( 
$request->getText( 'wpSummary' ), 255 );
 
                        # If the summary consists of a heading, e.g. 
'==Foobar==', extract the title from the
                        # header syntax, e.g. 'Foobar'. This is mainly an issue 
when we are using wpSummary for
@@ -2453,6 +2450,8 @@
         * @return String
         */
        protected function getSummaryPreview( $isSubjectPreview, $summary = "" 
) {
+               // avoid spaces in preview, gets always trimmed on save
+               $summary = trim( $summary );
                if ( !$summary || ( !$this->preview && !$this->diff ) ) {
                        return "";
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/49483
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0058ce31197f3ea8ffc5520f3f0f9e1bf6105066
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to