From 39666832a267a9cdc324761abbb8c592ee423f81 Mon Sep 17 00:00:00 2001 From: ShelbyTang <1044385041@qq.com> Date: Tue, 18 Aug 2026 18:05:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E6=94=AF=E6=8C=81=20Vue=20=E4=B8=8E=2028=20=E7=A7=8D?= =?UTF-8?q?=20legacy=20=E8=AF=AD=E8=A8=80=E8=AF=AD=E6=B3=95=E9=AB=98?= =?UTF-8?q?=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .vue 经 @codemirror/lang-vue 解析,显式 nestedLanguages 仅补 lang=tsx/jsx 与 ', + ) + const names = new Set() + let hasError = false + tree.iterate({ enter: (node) => { if (node.type.isError) hasError = true; names.add(node.name) } }) + expect(hasError).toBe(false) + expect(names.has('Script')).toBe(true) + expect(names.has('StyleSheet')).toBe(true) + expect(names.has('Interpolation')).toBe(true) + expect(names.has('SingleExpression')).toBe(true) + }) + + // P1-2 修复守护:') + const names = new Set() + let hasError = false + tree.iterate({ enter: (node) => { if (node.type.isError) hasError = true; names.add(node.name) } }) + expect(hasError).toBe(false) + // 两条正向鉴别:无 StyleSheet = CSS parser 未接管;无 StyleText = + // 内容确有 parser 接管(删掉 scss 条目时内容会退化回纯文本 StyleText)。 + expect(names.has('StyleSheet')).toBe(false) + expect(names.has('StyleText')).toBe(false) + }) }) describe('pdf preview kind', () => {