Parcourir la source

Apply suggestions from code review

Co-Authored-By: Maciej <jodator@jodator.net>
Mateusz Samsel il y a 6 ans
Parent
commit
87951fd453
1 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 5 5
      packages/ckeditor5-paste-from-office/src/filters/list.js

+ 5 - 5
packages/ckeditor5-paste-from-office/src/filters/list.js

@@ -233,7 +233,7 @@ function isNewListNeeded( previousItem, currentItem ) {
 
 // Paste from Google Docs
 /**
- * Removes paragraph wrapping content inside list item.
+ * Removes paragraph wrapping content inside a list item.
  *
  * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} elementOrDocumentFragment
  * @param {module:engine/view/upcastwriter~UpcastWriter} writer
@@ -256,7 +256,7 @@ export function unwrapParagraphInListItem( elementOrDocumentFragment, writer ) {
  * Moves nested list inside previous sibling element, what is a proper HTML standard.
  * There are 2 situations which are fixed in the for loop:
  *
- * 1. Move list to previous list item:
+ * 1. Move the list to a previous list item:
  *
  *		before                            after:
  *		OL                                OL
@@ -264,7 +264,7 @@ export function unwrapParagraphInListItem( elementOrDocumentFragment, writer ) {
  *		|-> OL                                |-> OL
  *		    |-> LI                                |-> LI
  *
- * 2. Unwrap nested list to avoid situation that UL or OL is direct child of another UL or OL.
+ * 2. Unwrap nested list if a list is a direct child of another list.
  *
  *		before                            after:
  *		OL                                OL
@@ -290,7 +290,7 @@ export function fixListIndentation( elementOrDocumentFragment, writer ) {
 	for ( const value of writer.createRangeIn( elementOrDocumentFragment ) ) {
 		const element = value.item;
 
-		// 1. Move nested list as child of sibling list item.
+		// case 1: The previous sibling of a list is a list item.
 		if ( element.is( 'li' ) ) {
 			const next = element.nextSibling;
 
@@ -300,7 +300,7 @@ export function fixListIndentation( elementOrDocumentFragment, writer ) {
 			}
 		}
 
-		// 2. Unwrap nested list
+		// case 2: The list is the first child of another list.
 		if ( isList( element ) ) {
 			let firstChild = element.getChild( 0 );