Skip to content

Commit

Permalink
Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Oct 16, 2023
1 parent 0c6ccd6 commit 8c7ed25
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,23 @@ export function makeFormDataFromFontFamilies( fontFamilies ) {
}
return face;
} );
const familyNames = family.fontFamily.split( ',' ).map( familyName => familyName.trim() );
const formattedFontFamilies = familyNames.map( name => {
const familyNames = family.fontFamily
.split( ',' )
.map( ( familyName ) => familyName.trim() );
const formattedFontFamilies = familyNames.map( ( name ) => {
if (
name.includes(' ') &&
!name.includes('"') &&
!name.includes("'")
name.includes( ' ' ) &&
! name.includes( '"' ) &&
! name.includes( "'" )
) {
return `'${name}'`;
return `'${ name }'`;
} else {
return name;
}
});
} );

if ( formattedFontFamilies.length > 1 ) {
family.fontFamily = formattedFontFamilies.join(', ');
family.fontFamily = formattedFontFamilies.join( ', ' );
}
}

Expand Down

0 comments on commit 8c7ed25

Please sign in to comment.