Skip to content

Commit

Permalink
call trim before ChipperStringUtils.addDirectionalFormatting, #619
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Nov 9, 2017
1 parent 93ef7f9 commit f7be23c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/grunt/getStringMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ module.exports = function( grunt, buildConfig ) {

for ( var stringKeyMissingPrefix in fileContents ) {
var stringData = fileContents[ stringKeyMissingPrefix ];

// remove leading/trailing whitespace, see chipper#619. Do this before addDirectionalFormatting
stringData.value = stringData.value.trim();
stringData.value = ChipperStringUtils.addDirectionalFormatting( stringData.value, isRTL );

// Add the requirejs namespaces (eg, JOIST) to the key
Expand Down
3 changes: 3 additions & 0 deletions js/requirejs-plugins/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ define( function( require ) {
text.get( url, function( loadedText ) {
var parsed = parse( loadedText );
for ( var stringKey in parsed ) {

// remove leading/trailing whitespace, see chipper#619. Do this before addDirectionalFormatting
parsed[ stringKey ].value = parsed[ stringKey ].value.trim();
parsed[ stringKey ].value = ChipperStringUtils.addDirectionalFormatting( parsed[ stringKey ].value, isRTL );
}
cache[ url ] = parsed;
Expand Down

0 comments on commit f7be23c

Please sign in to comment.