Procházet zdrojové kódy

Tests: Fix commands coverage.

Maciej Gołaszewski před 8 roky
rodič
revize
bb344355d0

+ 1 - 1
packages/ckeditor5-font/src/fontfamily/fontfamilycommand.js

@@ -58,7 +58,7 @@ export default class FontFamilyCommand extends Command {
 			const ranges = model.schema.getValidRanges( selection.getRanges(), 'fontFamily' );
 
 			for ( const range of ranges ) {
-				if ( value !== 'default' ) {
+				if ( value && value !== 'default' ) {
 					writer.setAttribute( 'fontFamily', value, range );
 				} else {
 					writer.removeAttribute( 'fontFamily', range );

+ 1 - 1
packages/ckeditor5-font/src/fontsize/fontsizecommand.js

@@ -57,7 +57,7 @@ export default class FontSizeCommand extends Command {
 			const ranges = model.schema.getValidRanges( selection.getRanges(), 'fontSize' );
 
 			for ( const range of ranges ) {
-				if ( value !== 'normal' ) {
+				if ( value && value !== 'normal' ) {
 					writer.setAttribute( 'fontSize', value, range );
 				} else {
 					writer.removeAttribute( 'fontSize', range );