fix(html): do not add extra indent for js template in script (#5527)
parent
cdac9552ef
commit
228a8b0782
|
@ -68,7 +68,7 @@ function embed(path, print, textToDoc, options) {
|
|||
concat([
|
||||
breakParent,
|
||||
printOpeningTagPrefix(node, options),
|
||||
markAsRoot(stripTrailingHardline(textToDoc(value, { parser }))),
|
||||
stripTrailingHardline(textToDoc(value, { parser })),
|
||||
printClosingTagSuffix(node, options)
|
||||
])
|
||||
]);
|
||||
|
|
|
@ -127,6 +127,42 @@ exports[`something-else.html - html-verify 1`] = `
|
|||
|
||||
`;
|
||||
|
||||
exports[`template-literal.html - html-verify 1`] = `
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function foo() {
|
||||
return \`
|
||||
<div>
|
||||
<p>Text</p>
|
||||
</div>
|
||||
\`;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head> </head>
|
||||
<body>
|
||||
<script>
|
||||
function foo() {
|
||||
return \`
|
||||
<div>
|
||||
<p>Text</p>
|
||||
</div>
|
||||
\`;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
`;
|
||||
|
||||
exports[`typescript.html - html-verify 1`] = `
|
||||
<script type="application/x-typescript">
|
||||
class Student {
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function foo() {
|
||||
return `
|
||||
<div>
|
||||
<p>Text</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue