Merge "modifier: Fix whitespace trim inconsistency"

This commit is contained in:
jenkins-bot 2021-03-24 22:02:57 +00:00 committed by Gerrit Code Review
commit 027f8983a2
2 changed files with 2 additions and 2 deletions

View file

@ -478,7 +478,7 @@ class CommentModifier {
// If the last node is empty, trim the signature to prevent leading whitespace triggering // If the last node is empty, trim the signature to prevent leading whitespace triggering
// preformatted text (T269188, T276612) // preformatted text (T269188, T276612)
if ( !$container->lastChild->firstChild ) { if ( !$container->lastChild->firstChild ) {
$signature = trim( $signature ); $signature = ltrim( $signature, ' ' );
} }
// Sign the last line // Sign the last line
$container->lastChild->appendChild( $container->lastChild->appendChild(

View file

@ -434,7 +434,7 @@ function appendSignature( container ) {
// If the last node is empty, trim the signature to prevent leading whitespace triggering // If the last node is empty, trim the signature to prevent leading whitespace triggering
// preformatted text (T269188, T276612) // preformatted text (T269188, T276612)
if ( !container.lastChild.firstChild ) { if ( !container.lastChild.firstChild ) {
signature = signature.trim(); signature = signature.replace( /^ +/, '' );
} }
// Sign the last line // Sign the last line
container.lastChild.appendChild( container.lastChild.appendChild(