jenkins-bot has submitted this change and it was merged. Change subject: TemplateParser: Fix whitespace trim ......................................................................
TemplateParser: Fix whitespace trim Bug: 57458 Change-Id: Id916ec3070ef49ea7b2e4d602805596593adcca4 --- M TemplateParser.php M tests/data/File_Dala_Kyrka.JPG.php 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/TemplateParser.php b/TemplateParser.php index 5f70dac..5e0c6c0 100755 --- a/TemplateParser.php +++ b/TemplateParser.php @@ -61,7 +61,7 @@ * @var array */ protected static $cleanupPatterns = array( - '/^\s+(.*)\s+$/' => '\1', // trim whitespace + '/^\s+|\s+$/' => '', // trim leading or trailing whitespace '/^<p>(.*)<\/p>$/' => '\1', // clean paragraph with no styling - usually generated by MediaWiki ); diff --git a/tests/data/File_Dala_Kyrka.JPG.php b/tests/data/File_Dala_Kyrka.JPG.php index d9e873c..e24b365 100644 --- a/tests/data/File_Dala_Kyrka.JPG.php +++ b/tests/data/File_Dala_Kyrka.JPG.php @@ -17,7 +17,7 @@ ), 'ImageDescription' => array ( - 'value' => ' Dala kyrka, mot väg', + 'value' => 'Dala kyrka, mot väg', 'source' => 'commons-desc-page', ), 'Credit' => -- To view, visit https://gerrit.wikimedia.org/r/155901 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id916ec3070ef49ea7b2e4d602805596593adcca4 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CommonsMetadata Gerrit-Branch: master Gerrit-Owner: TheDJ <hartman.w...@gmail.com> Gerrit-Reviewer: Gergő Tisza <gti...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits