@@ -52,14 +52,13 @@ const isSpecialTag = (tag, isSFC, stack) => {
if (isScriptOrStyle(tag)) {
return true
}
- // top-level template that has a pre-processor
- if (
- isSFC &&
- tag === 'template' &&
- stack.length === 1 &&
- stack[0].attrs.some(hasLang)
- ) {
- return true
+ if (isSFC) {
+ // top-level template that has no pre-processor
+ if (tag === 'template' && stack.length === 1 && !stack[0].attrs.some(hasLang)) {
+ return false
+ } else {
+ return true
+ }
return false
@@ -78,7 +78,7 @@ describe('Single File Component parser', () => {
expect(res.template.content.trim()).toBe(`div\n h1(v-if='1 < 2') hello`)
})
- it('should handle custom blocks without without parsing them', () => {
+ it('should handle custom blocks without parsing them', () => {
const res = parseComponent(`
<template>
<div></div>