Skip to content
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

HTML Templating un-indents template helpers #13052

Open
core-ai-bot opened this issue Aug 31, 2021 · 1 comment
Open

HTML Templating un-indents template helpers #13052

core-ai-bot opened this issue Aug 31, 2021 · 1 comment

Comments

@core-ai-bot
Copy link
Member

Issue by jeffshaver
Tuesday Feb 10, 2015 at 14:30 GMT
Originally opened as adobe/brackets#10564


If you type something like:

<div class="blah">
  {{#each posts}}

  {{/each}}
</div>

If you type more brackets inside the each template helper, it gets un-indented and you end up with

<div class="blah">
  {{#each posts}}
  {{post.title}}
  {{/each}}
</div>

instead of

<div class="blah">
  {{#each posts}}
    {{post.title}}
  {{/each}}
</div>
@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Feb 10, 2015 at 20:50 GMT


The main issue is that the plain HTML syntax mode doesn't know that {{#each}} blocks should add an extra level of indent, so anything that triggers re-indentation will jump the cursor back one tab stop. As a secondary bug, Brackets treats } as a character to trigger re-indentation even in languages where it shouldn't, like HTML.

The secondary bug should be fixed by PR #9387. But after that, you'll still see unwanted un-indenting when typing closing HTML tags. To fix that, we'd need full syntax mode support for templating languages so that Brackets understands what the correct indent level should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant