瀏覽代碼

Use selection.getAttributeKeys() for selection attributes names retrieval.

Maciej Gołaszewski 6 年之前
父節點
當前提交
634e03d796
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/ckeditor5-enter/src/shiftentercommand.js

+ 1 - 1
packages/ckeditor5-enter/src/shiftentercommand.js

@@ -85,7 +85,7 @@ function softBreakAction( model, writer, selection ) {
 		const attributesToCopy = getCopyOnEnterAttributes( model.schema, selection.getAttributes() );
 		insertBreak( writer, range.end );
 
-		writer.removeSelectionAttribute( Array.from( selection.getAttributes() ).map( x => x[ 0 ] ) );
+		writer.removeSelectionAttribute( Array.from( selection.getAttributeKeys() ) );
 		writer.setSelectionAttribute( attributesToCopy );
 	} else {
 		const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );