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

"In" Containment Operator in Twig #2295

Closed
5 tasks
ghost opened this issue Jan 14, 2019 · 2 comments
Closed
5 tasks

"In" Containment Operator in Twig #2295

ghost opened this issue Jan 14, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 14, 2019

Description

The results of beautification are not what I expect.

Input Before Beautification

  {% if label_display in ['before', 'invisible'] %}
    <div class="col-4-md">
      {{ label }}
    </div>
  {% endif %}

Expected Output

The beautified code should have looked like this:

  {% if label_display in ['before', 'invisible'] %}
    <div class="col-4-md">
      {{ label }}
    </div>
  {% endif %}


Actual Output

The beautified code actually looked like this:

Deleting space after In operator. Causing Twig snytax errors.


  {% if label_display in['before', 'invisible'] %}
    <div class="col-4-md">
      {{ label }}
    </div>
  {% endif %}

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

Debug

Here is a link to the debug.md Gist:

Checklist

I have:

  • Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • Reloaded (or restarted) Atom to ensure it is not a caching issue
  • Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
@prettydiff
Copy link
Collaborator

Check which beautifier you are using internally within Atom Beautify. I believe, though I could be wrong, that Pretty Diff is the default beautifier for Twig. If this is a Pretty Diff defect please assist us with getting the latest major version of Pretty Diff into Unibeautify (Atom Beautify's successor) since this defect is no longer present in Pretty Diff: Unibeautify/beautifier-prettydiff#114

If the defect is the result of a different beautifier please open an issue with the other beautifier.

@stale
Copy link

stale bot commented Mar 16, 2019

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 16, 2019
@stale stale bot closed this as completed Mar 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant