prettier
bff049fd - handlebars: Support escaping a mustache with a backslash (#8634)

Commit
5 years ago
handlebars: Support escaping a mustache with a backslash (#8634) * Add a failing test * Support escaping a mustache with `\` It is documented in handlebarjs documentation here: https://handlebarsjs.com/guide/expressions.html#escaping-handlebars-expressions * Preprocess TextNode to adjust the need of backslashes Given that template: ```hbs a non-escaped mustache: \\\{{helper}} ``` Glimmer parser will produce two body nodes: - a TextNode where `node.chars === "a non-escaped mustache: \\\\"` - a MustacheStatement for `{{helper}}` In order to correctly print the input, we need to adjust the TextNode to `node.chars === "a non-escaped mustache: \\\\\\"`, namely we have to add a backslash that is removed by Glimmer parser. This is this commit purpose. * Add changelog note
Author
Parents
Loading