diff --git a/src/schemas/core.js b/src/schemas/core.js index 158ce1b6d..c77b26b10 100644 --- a/src/schemas/core.js +++ b/src/schemas/core.js @@ -184,7 +184,7 @@ const rules = [ const prev = index > 0 ? node.nodes.get(index - 1) : null const next = node.nodes.get(index + 1) const insertBefore = !prev - const insertAfter = !next || isInlineVoid(next) + const insertAfter = !next || (next.kind == 'inline') if (insertAfter || insertBefore) { list = list.push({ insertAfter, insertBefore, index }) @@ -267,13 +267,13 @@ const rules = [ const next = nodes.get(i + 1) // If it's the first node, and the next is a void, preserve it. - if (!prev && isInlineVoid(next)) return + if (!prev && next.kind == 'inline') return - // It it's the last node, and the previous is a void, preserve it. - if (!next && isInlineVoid(prev)) return + // It it's the last node, and the previous is an inline, preserve it. + if (!next && prev.kind == 'inline') return - // If it's surrounded by voids, preserve it. - if (next && prev && isInlineVoid(next) && isInlineVoid(prev)) return + // If it's surrounded by inlines, preserve it. + if (next && prev && next.kind == 'inline' && prev.kind == 'inline') return // Otherwise, remove it. return true @@ -290,17 +290,6 @@ const rules = [ ] -/** - * Test if a `node` is an inline void node. - * - * @param {Node} node - * @return {Boolean} - */ - -function isInlineVoid(node) { - return (node.kind == 'inline' && node.isVoid) -} - /** * Create the core schema. *