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

Commit

Permalink
Do not insert <br> into custom elements
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Oct 22, 2016
1 parent f75096e commit 75d97b4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ define([
while (node) {
if (!nodeHelpers.isSelectionMarkerNode(node)) {
// Find any node that contains no child *elements*, or just contains
// whitespace, and is not self-closing
// whitespace, is not self-closing and is not a custom element
if (isEmpty(node) &&
node.textContent.trim() === '' &&
!html5VoidElements.includes(node.nodeName)) {
!html5VoidElements.includes(node.nodeName) &&
node.nodeName.indexOf('-') === -1) {
node.appendChild(document.createElement('br'));
} else if (node.children.length > 0) {
traverse(node);
Expand Down

0 comments on commit 75d97b4

Please sign in to comment.