diff --git a/src/parse/state/mustache.ts b/src/parse/state/mustache.ts index 980ec8555a..bdeb8bdede 100644 --- a/src/parse/state/mustache.ts +++ b/src/parse/state/mustache.ts @@ -316,6 +316,8 @@ export default function mustache(parser: Parser) { } } else if (parser.eat('@html')) { // {@html content} tag + parser.requireWhitespace(); + const expression = readExpression(parser); parser.allowWhitespace(); diff --git a/test/parser/samples/raw-mustaches-whitespace-error/error.json b/test/parser/samples/raw-mustaches-whitespace-error/error.json new file mode 100644 index 0000000000..abb9f8ed0f --- /dev/null +++ b/test/parser/samples/raw-mustaches-whitespace-error/error.json @@ -0,0 +1,10 @@ +{ + "code": "missing-whitespace", + "message": "Expected whitespace", + "start": { + "line": 1, + "column": 6, + "character": 6 + }, + "pos": 6 +} diff --git a/test/parser/samples/raw-mustaches-whitespace-error/input.svelte b/test/parser/samples/raw-mustaches-whitespace-error/input.svelte new file mode 100644 index 0000000000..94e75fda09 --- /dev/null +++ b/test/parser/samples/raw-mustaches-whitespace-error/input.svelte @@ -0,0 +1 @@ +{@htmlfoo}