mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
modifier: Fix whitespace trim inconsistency
The JS and PHP trim() methods remove different characters. Change-Id: I8ae5526ea5033e345b6a6b63ea447c394956d988
This commit is contained in:
parent
4ae22ab6dc
commit
3ac540af95
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue