diff --git a/includes/CommentModifier.php b/includes/CommentModifier.php index 00f484d04..a5e833455 100644 --- a/includes/CommentModifier.php +++ b/includes/CommentModifier.php @@ -478,7 +478,7 @@ class CommentModifier { // If the last node is empty, trim the signature to prevent leading whitespace triggering // preformatted text (T269188, T276612) if ( !$container->lastChild->firstChild ) { - $signature = trim( $signature ); + $signature = ltrim( $signature, ' ' ); } // Sign the last line $container->lastChild->appendChild( diff --git a/modules/modifier.js b/modules/modifier.js index 84ff7bef9..d323b56e3 100644 --- a/modules/modifier.js +++ b/modules/modifier.js @@ -434,7 +434,7 @@ function appendSignature( container ) { // If the last node is empty, trim the signature to prevent leading whitespace triggering // preformatted text (T269188, T276612) if ( !container.lastChild.firstChild ) { - signature = signature.trim(); + signature = signature.replace( /^ +/, '' ); } // Sign the last line container.lastChild.appendChild(