0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 00:46:29 +01:00

dont warn on empty block for nbsp - fixes #1658

This commit is contained in:
Rich Harris 2018-08-24 08:22:41 -04:00
parent 4890d4dc02
commit c52a6f011b
4 changed files with 8 additions and 1 deletions

View File

@ -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) {

View File

@ -0,0 +1,3 @@
export default {
dev: true
};

View File

@ -0,0 +1,3 @@
{#if x}
 
{/if}

View File

@ -0,0 +1 @@
[]