From 52f88f268328a563080c68cda984fbe4555b667b Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Tue, 14 May 2024 13:08:46 +0800 Subject: [PATCH] fix(language-core): template language of .md files should be markdown close #4299 --- packages/language-core/lib/plugins/file-md.ts | 1 + packages/language-core/lib/plugins/vue-template-html.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/language-core/lib/plugins/file-md.ts b/packages/language-core/lib/plugins/file-md.ts index 561896c28d..31abec506a 100644 --- a/packages/language-core/lib/plugins/file-md.ts +++ b/packages/language-core/lib/plugins/file-md.ts @@ -54,6 +54,7 @@ const plugin: VueLanguagePlugin = () => { const sfc = parse(toString(codes)); if (sfc.descriptor.template) { + sfc.descriptor.template.lang = 'md'; transformRange(sfc.descriptor.template); } if (sfc.descriptor.script) { diff --git a/packages/language-core/lib/plugins/vue-template-html.ts b/packages/language-core/lib/plugins/vue-template-html.ts index cf193d3aba..f6c324ae9e 100644 --- a/packages/language-core/lib/plugins/vue-template-html.ts +++ b/packages/language-core/lib/plugins/vue-template-html.ts @@ -16,7 +16,7 @@ const plugin: VueLanguagePlugin = ({ modules }) => { compileSFCTemplate(lang, template, options) { - if (lang === 'html') { + if (lang === 'html' || lang === 'md') { const compiler = modules['@vue/compiler-dom'];