From: Evan You Date: Thu, 7 May 2020 15:08:17 +0000 (-0400) Subject: fix(compiler-sfc): template with alt lang should be parsed as raw text X-Git-Tag: v3.0.0-beta.10~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d10835aee73e3be579c728df634fbaa8fe3a0e0f;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): template with alt lang should be parsed as raw text fix #1120 --- diff --git a/packages/compiler-sfc/__tests__/parse.spec.ts b/packages/compiler-sfc/__tests__/parse.spec.ts index ddd6570de9..d7d8ca6b2e 100644 --- a/packages/compiler-sfc/__tests__/parse.spec.ts +++ b/packages/compiler-sfc/__tests__/parse.spec.ts @@ -106,6 +106,16 @@ h1 { color: red } expect(descriptor.template!.content).toBe(content) }) + // #1120 + test('alternative template lang should be treated as plain text', () => { + const content = `p(v-if="1 < 2") test` + const { descriptor, errors } = parse( + `` + ) + expect(errors.length).toBe(0) + expect(descriptor.template!.content).toBe(content) + }) + test('error tolerance', () => { const { errors } = parse(`