expect(descriptor.template!.content).toBe(content)
})
+ //#2566
+ test('div lang should not be treated as plain text', () => {
+ const { errors } = parse(`
+ <template lang="pug">
+ <div lang="">
+ <div></div>
+ </div>
+ </template>
+ `)
+ expect(errors.length).toBe(0)
+ })
+
test('error tolerance', () => {
const { errors } = parse(`<template>`)
expect(errors.length).toBe(1)
if (
(!parent && tag !== 'template') ||
// <template lang="xxx"> should also be treated as raw text
- props.some(
- p =>
- p.type === NodeTypes.ATTRIBUTE &&
- p.name === 'lang' &&
- p.value &&
- p.value.content !== 'html'
- )
+ (tag === 'template' &&
+ props.some(
+ p =>
+ p.type === NodeTypes.ATTRIBUTE &&
+ p.name === 'lang' &&
+ p.value &&
+ p.value.content !== 'html'
+ ))
) {
return TextModes.RAWTEXT
} else {