From b274b08f5ff56d153d3dd46fa740dd6b156bf26f Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 19 Jul 2021 17:05:37 -0400 Subject: [PATCH] fix(compiler-sfc): expose correct range for empty blocks --- packages/compiler-sfc/__tests__/parse.spec.ts | 18 +++++++++++++++++- packages/compiler-sfc/src/parse.ts | 10 ++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/compiler-sfc/__tests__/parse.spec.ts b/packages/compiler-sfc/__tests__/parse.spec.ts index 2c640853b1a..fff6cf3c29f 100644 --- a/packages/compiler-sfc/__tests__/parse.spec.ts +++ b/packages/compiler-sfc/__tests__/parse.spec.ts @@ -111,10 +111,26 @@ h1 { color: red } ) }) - test('should keep template nodes with no content', () => { + test('should parse correct range for blocks with no content (self closing)', () => { const { descriptor } = parse(`