Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #7958 by checking for valid firstChild. #7959

Merged
merged 1 commit into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ckeditor5-paste-from-office/src/filters/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function unwrapParagraphInListItem( documentFragment, writer ) {
// Google Docs allows on single paragraph inside LI.
const firstChild = element.getChild( 0 );

if ( firstChild.is( 'element', 'p' ) ) {
if ( firstChild && firstChild.is( 'element', 'p' ) ) {
writer.unwrapElement( firstChild );
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<meta charset='utf-8'><meta charset="utf-8"><b style="font-weight:normal;" id="docs-internal-guid-7f8963f3-7fff-683a-b3de-156ff66d4860"><ul style="margin-top:0;margin-bottom:0;"><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Item 1</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><br /></li></ul></b>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<listItem listIndent="0" listType="bulleted">Item 1</listItem><listItem listIndent="0" listType="bulleted"></listItem>
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,23 @@ import repeatedlyNestedListModel from './repeatedly-nested-list/model.html';
import partiallySelected from './partially-selected/input.html';
import partiallySelectedModel from './partially-selected/model.html';

import emptyListItem from './empty-list-item/input.html';
import emptyListItemModel from './empty-list-item/model.html';

export const fixtures = {
input: {
nestedOrderedList,
mixedList,
repeatedlyNestedList,
partiallySelected
partiallySelected,
emptyListItem
},
model: {
nestedOrderedList: nestedOrderedListModel,
mixedList: mixedListModel,
repeatedlyNestedList: repeatedlyNestedListModel,
partiallySelected: partiallySelectedModel
partiallySelected: partiallySelectedModel,
emptyListItem: emptyListItemModel
}
};

Expand Down