-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handlebars support #4
Comments
if (indent_handlebars) {
// Handlebars parsing is complicated.
// {{#foo}} and {{/foo}} are formatted tags.
// {{something}} should get treated as content, except:
// {{else}} specifically behaves like {{#if}} and {{/if}}
var peek3 = this.input.substr(this.pos, 3);
if (peek3 === '{{#' || peek3 === '{{/') {
// These are tags and not content.
break;
} else if (this.input.substr(this.pos, 2) === '{{') {
if (this.get_tag(true) === '{{else}}') {
break;
}
}
} It looks like If this is configurable, then we are all set! How about when the file extension is |
Reproduce this bug: {{#if flag}} content1 {{else}} content2 {{/if}} Then {{#if flag}}
content1
{{else}}
content2
{{/if}} |
Moving to Glavin001/atom-beautify#13. |
Currently, the HTML beautifier will treat Handlebars as content. I believe js-beautifier does support indentation of Handlebars in HTML code. I will look into this further and get back with my findings.
Please +1 if you are interesting in this feature; I may even submit a Pull Request if it will help.
/cc @Frozenfire92
The text was updated successfully, but these errors were encountered: