fix(compiler-sfc): fix parsing error when lang="" is used on plain element (#2569)
fix #2566
This commit is contained in:
@@ -115,13 +115,14 @@ export function parse(
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user