Skip to content

Commit

Permalink
Fix Vue pug rendering by specifying HTML5 by default (#8051)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jengamon committed May 8, 2022
1 parent e6a6684 commit 1568064
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/transformers/vue/src/VueTransformer.js
Expand Up @@ -225,7 +225,14 @@ async function processPipeline({
}
let content = template.content;
if (template.lang && !['htm', 'html'].includes(template.lang)) {
let options = {};
let preprocessor = consolidate[template.lang];
// Pug doctype fix (fixes #7756)
switch (template.lang) {
case 'pug':
options.doctype = 'html';
break;
}
if (!preprocessor) {
// TODO: codeframe
throw new ThrowableDiagnostic({
Expand All @@ -235,7 +242,7 @@ async function processPipeline({
},
});
}
content = await preprocessor.render(content, {});
content = await preprocessor.render(content, options);
}
let templateComp = compiler.compileTemplate({
filename: asset.filePath,
Expand Down

0 comments on commit 1568064

Please sign in to comment.