Explorar el Código

Don\'t apply ParagraphCommand if already applied.

Aleksander Nowodzinski hace 8 años
padre
commit
11193252d0
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      packages/ckeditor5-paragraph/src/paragraphcommand.js

+ 4 - 0
packages/ckeditor5-paragraph/src/paragraphcommand.js

@@ -58,6 +58,10 @@ export default class ParagraphCommand extends Command {
 	 * By default, if not provided, the command is applied to current {@link module:engine/model/document~Document#selection}.
 	 */
 	_doExecute( options = {} ) {
+		if ( this.value && !options.element ) {
+			return;
+		}
+
 		const document = this.editor.document;
 
 		document.enqueueChanges( () => {