Skip to content

Commit

Permalink
fix(slate) only remove nodes with a single empty text node
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed Dec 17, 2019
1 parent 28574e7 commit 7231419
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/markdown-slate/src/slateToCiceroMarkDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const removeEmptyParagraphs = (input) => {
let nodesWithoutBlankParagraphs = [];
input.nodes.forEach(node => {
if (node.$class === 'org.accordproject.commonmark.Paragraph' &&
node.nodes.length === 1 &&
node.nodes[0].$class === 'org.accordproject.commonmark.Text' &&
node.nodes[0].text === '') {
return;
Expand Down

0 comments on commit 7231419

Please sign in to comment.