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

Commit

Permalink
Fix for Chrome 27 to 34
Browse files Browse the repository at this point in the history
  • Loading branch information
robinedman committed Jun 17, 2014
1 parent e7e42c1 commit dc86bf5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/core/patches/commands/insert-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ define(['../../../../api/element'], function (element) {
listParentNode.parentNode.insertBefore(listElement, listParentNode.nextElementSibling);
selection.selectMarkers();
// Remove the block if it's empty
if (listParentNode.childNodes.length === 0 ||
(listParentNode.childNodes.length === 1 &&
listParentNode.childNodes[0].nodeName === 'BR')) {
if (listParentNode.childNodes.length === 0
|| (listParentNode.childNodes.length === 1 && listParentNode.firstChild.nodeName === 'BR')
|| (listParentNode.firstChild.nodeType === Node.TEXT_NODE && listParentNode.firstChild.textContent === '')) {
listParentNode.parentNode.removeChild(listParentNode);
}
}
Expand Down

0 comments on commit dc86bf5

Please sign in to comment.