dont warn on empty block for nbsp - fixes #1658

pull/1683/head
Rich Harris 6 years ago
parent 4890d4dc02
commit c52a6f011b

@ -14,7 +14,7 @@ function isEmptyBlock(node: Node) {
if (!/Block$/.test(node.type) || !node.children) return false;
if (node.children.length > 1) return false;
const child = node.children[0];
return !child || (child.type === 'Text' && !/\S/.test(child.data));
return !child || (child.type === 'Text' && !/[^ \r\n\f\v\t]/.test(child.data));
}
export default function validateHtml(validator: Validator, html: Node) {

Loading…
Cancel
Save