diff --git a/packages/compiler-core/__tests__/parse.spec.ts b/packages/compiler-core/__tests__/parse.spec.ts index 37e81e64924..77211b2f5fb 100644 --- a/packages/compiler-core/__tests__/parse.spec.ts +++ b/packages/compiler-core/__tests__/parse.spec.ts @@ -2019,6 +2019,21 @@ describe('compiler: parse', () => { children: [{ type: NodeTypes.TEXT, content: `{{ number ` }], }, ]) + + const ast3 = baseParse(`
`, { + parseMode: 'html', + }) + expect((ast3.children[0] as ElementNode).children).toMatchObject([ + { + type: NodeTypes.ELEMENT, + children: [ + { + type: NodeTypes.TEXT, + content: `{{ foo `, + }, + ], + }, + ]) }) test('self-closing v-pre', () => { diff --git a/packages/compiler-core/src/tokenizer.ts b/packages/compiler-core/src/tokenizer.ts index 35c49fa6545..329e8b48181 100644 --- a/packages/compiler-core/src/tokenizer.ts +++ b/packages/compiler-core/src/tokenizer.ts @@ -438,7 +438,7 @@ export default class Tokenizer { // We have to parse entities in and <textarea> tags. if (!__BROWSER__ && c === CharCodes.Amp) { this.startEntity() - } else if (c === this.delimiterOpen[0]) { + } else if (!this.inVPre && c === this.delimiterOpen[0]) { // We also need to handle interpolation this.state = State.InterpolationOpen this.delimiterIndex = 0