Skip to content

Commit baa07a3

Browse files
authored
Merge pull request #3223 from spinframework/template-display-quad-curly
expressions: Fix Display for Template escaping
2 parents af59cd1 + 1afda39 commit baa07a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/expressions/src/template.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ impl Display for Template {
5555
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5656
self.parts().try_for_each(|part| match part {
5757
Part::Lit(lit) => f.write_str(lit),
58-
Part::Expr(expr) => write!(f, "{{ {expr} }}"),
58+
// Rust format strings escape "{" with "{{"", so "{{" becomes "{{{{"
59+
Part::Expr(expr) => write!(f, "{{{{ {expr} }}}}"),
5960
})
6061
}
6162
}

0 commit comments

Comments
 (0)