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

Continuous indentation wrapped smarty code in pre tags or vice versa #281

Open
Namstel opened this issue Aug 2, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Namstel
Copy link

Namstel commented Aug 2, 2021

Describe the bug
When I write smarty code within a foreach loop within HTML pre tags, running the code formatter keeps inserting tabs/spaces when triggered.

To Reproduce
Take this code:

<pre>
  {$array = ["a thing"]}
  {foreach $array as $item}
    {$item}
  {/foreach}
</pre>

Now trigger the Format Document command several time and you will see it will keep indenting the line with {$item}.

Expected behavior
I expect it to indent correctly once (if needed), and then stop.

Context (please complete the following information):

  • Version 1.9.0
@Namstel
Copy link
Author

Namstel commented Aug 3, 2021

I found out that it isn't just happening with the foreach loop, but whenever there's a piece of smarty code wrapped, so also with an if statement.

{$array = ["a thing"]}
<pre>
{if $item === "a thing"}
  {$item}
{/if}
</pre>

{if $item === "a thing"}
  <pre>
    {$item}
  </pre>
{/if}

It only seems to happen with the pre tags.

@Namstel Namstel changed the title Continuous indentation foreach loop code in pre tags Continuous indentation wrapped smarty code in pre tags or vice versa Aug 3, 2021
@aswinkumar863 aswinkumar863 added the bug Something isn't working label Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants