Handlebars: Fix invalid output for <style> containing mustaches (#20030)

Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
Konv Suuandfisker authored and GitHub committed 2026-09-11 18:09:38 +08:00
1 parent 3014654149
commit c150b07c07
8 files changed
+105 -16

No files matched your search

@@ -13,10 +13,14 @@ parsers: ["glimmer"]
</style>
</div>
<style></style>
=====================================output=====================================
<div>
<style></style>
</div>
<style></style>
================================================================================
`;
@@ -195,3 +199,38 @@ parsers: ["glimmer"]
</style>
================================================================================
`;
exports[`with-mustache.hbs format 1`] = `
====================================options=====================================
parsers: ["glimmer"]
printWidth: 80 (default) |
=====================================input======================================
<style>
a {
color: {{foo}}
}
</style>
<style>
.a { color: {{color}}; }
{{#if debug}}.b { color: red; }{{/if}}
</style>
<style>{{foo}}</style>
=====================================output=====================================
<style>
a { color:
{{foo}}
}
</style>
<style>
.a { color:
{{color}}; }
{{#if debug}}.b { color: red; }{{/if}}
</style>
<style>{{foo}}</style>
================================================================================
`;
@@ -5,3 +5,5 @@
</style>
</div>
<style></style>
@@ -0,0 +1,12 @@
<style>
a {
color: {{foo}}
}
</style>
<style>
.a { color: {{color}}; }
{{#if debug}}.b { color: red; }{{/if}}
</style>
<style>{{foo}}</style>