Browse Source

Changed manual test description. Fixed comments.

Szymon Kupś 9 năm trước cách đây
mục cha
commit
6abb2218d2

+ 11 - 12
packages/ckeditor5-heading/src/formatscommand.js

@@ -121,23 +121,22 @@ export default class FormatsCommand extends Command {
 	}
 	}
 }
 }
 
 
-/**
- * Looks for topmost element from position parent to element placed in root.
- *
- * NOTE: This method does not checks schema directly - assumes that only block elements can be placed directly inside
- * root.
- *
- * @param {engine.model.Position} position
- * @param {Boolean} [nodeAfter=true] When position is placed inside root element this will determine if element before
- * or after given position will be returned.
- * @returns {engine.model.Element}
- */
+// Looks for topmost element from position parent to element placed in root.
+//
+// NOTE: This method does not checks schema directly - assumes that only block elements can be placed directly inside
+// root.
+//
+// @private
+// @param {engine.model.Position} position
+// @param {Boolean} [nodeAfter=true] When position is placed inside root element this will determine if element before
+// or after given position will be returned.
+// @returns {engine.model.Element}
 function findTopmostBlock( position, nodeAfter = true ) {
 function findTopmostBlock( position, nodeAfter = true ) {
 	let parent = position.parent;
 	let parent = position.parent;
 
 
 	// If position is placed inside root - get element after/before it.
 	// If position is placed inside root - get element after/before it.
 	if ( parent instanceof RootElement ) {
 	if ( parent instanceof RootElement ) {
-		return nodeAfter ? position.nodeAfter : position.nodeBefore ;
+		return nodeAfter ? position.nodeAfter : position.nodeBefore;
 	}
 	}
 
 
 	while ( !( parent.parent instanceof RootElement ) ) {
 	while ( !( parent.parent instanceof RootElement ) ) {

+ 1 - 0
packages/ckeditor5-heading/tests/manual/formats.md

@@ -6,4 +6,5 @@
 2. Put selection inside each block and check if dropdown label is changing properly.
 2. Put selection inside each block and check if dropdown label is changing properly.
 3. Play with formatting:
 3. Play with formatting:
 	- Switch formats using dropdown.
 	- Switch formats using dropdown.
+	- Apply same format twice to same block to see if its switching with paragraph.
 	- Put selection that spans across multiple blocks and switch formats.
 	- Put selection that spans across multiple blocks and switch formats.