소스 검색

Tests: Fix commands coverage.

Maciej Gołaszewski 8 년 전
부모
커밋
bb344355d0
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      packages/ckeditor5-font/src/fontfamily/fontfamilycommand.js
  2. 1 1
      packages/ckeditor5-font/src/fontsize/fontsizecommand.js

+ 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 );