Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Maciej <jodator@jodator.net>
  • Loading branch information
msamsel and jodator committed Aug 2, 2019
1 parent c9b208f commit 85c8764
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/filters/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -256,15 +256,15 @@ 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
* |-> LI |-> LI
* |-> 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
Expand All @@ -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;

Expand All @@ -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 );

Expand Down

0 comments on commit 85c8764

Please sign in to comment.