mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-01 03:26:28 +00:00
Merge "modifier: Fix whitespace trim inconsistency"
This commit is contained in:
commit
027f8983a2
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue