From 8738b0a48da752d93950acb0654d121f724cbdef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Fri, 2 Dec 2016 17:53:12 +0100 Subject: [PATCH] Fix condition in core rule to add test around all inlines --- src/schemas/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schemas/core.js b/src/schemas/core.js index c77b26b10..9746428b5 100644 --- a/src/schemas/core.js +++ b/src/schemas/core.js @@ -178,11 +178,11 @@ const rules = [ }, validate: (node) => { const invalids = node.nodes.reduce((list, child, index) => { - if (child.kind == 'block') return list - if (!child.isVoid) return list + if (child.kind !== 'inline') return list const prev = index > 0 ? node.nodes.get(index - 1) : null const next = node.nodes.get(index + 1) + // We don't test if "prev" is inline, since it has already been processed in the loop const insertBefore = !prev const insertAfter = !next || (next.kind == 'inline')