-
Notifications
You must be signed in to change notification settings - Fork 834
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
Twig Indenting code format, not indenting correctly #4869
Comments
Please write an example code to reproduce it. Thanks! |
@junichi11 I hope the above code and layout is to you standard Prepared to help and test the functionality |
Just wait. Please write a simple example code if possible. An expected result and an actual result, too. |
Thank you @junichi11expected result{% block content %} {#The twig logic alignment should take preferance above HTML except when Twig conditions "If / For" loop is used inside a html div#}
{% endblock %} Actual result after code format used{% block content %}
{% endblock %} |
Hi @junichi11, I found addition BUG missing closing brackets under twig when creating new <script's
|
If possible, I know you under pressure. Others will also benefit from it. Thanks for your time to make NetBeans the best. |
@junichi11 |
@junichi11 any news regarding the code formatting in Twig |
Unfortunately, we can't fix this case from the twig module. <div class="container">
{% if nextmemberid == ''%}
<form action="{{ route('accmember',{_memberid:currentmember.memberid}) }}" method="POST">
<input type="hidden" name="memberid" value="{{ currentmember.memberid }}">
{% else %}
<form action="{{ route('accmember',{_memberid:nextmemberid}) }}" method="POST">
<input type="hidden" name="memberid" value="{{ nextmemberid }}">
{% endif %}
</form>
</div> If you close the HTML tag, maybe it works correctly. <div class="container">
{% if nextmemberid == ''%}
<form action="{{ route('accmember',{_memberid:currentmember.memberid}) }}" method="POST">
<input type="hidden" name="memberid" value="{{ currentmember.memberid }}">
</form>
{% else %}
<form action="{{ route('accmember',{_memberid:nextmemberid}) }}" method="POST">
<input type="hidden" name="memberid" value="{{ nextmemberid }}">
</form>
{% endif %}
</div> As a workaround: {% if nextmemberid == ''%}
{% set example = 'foo' %}
{% set value = 'a' %}
{% else %}
{% set example = 'bar' %}
{% set value = 'b' %}
{% endif %}
<form action="{{ example }}" method="POST">
<input type="hidden" name="memberid" value="{{ value }}">
</form> |
thank you for trying |
Apache NetBeans version
Apache NetBeans 15
What happened
Im using Twig, the (IF statement does not align,
How to reproduce
Detail same as in what happened
Did this work correctly in an earlier version?
Apache NetBeans 12.6 or earlier
Operating System
Windows 10 X64
JDK
19
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
Every time you use Twig file and try to do source format.
Are you willing to submit a pull request?
Yes
Code of Conduct
Yes
The text was updated successfully, but these errors were encountered: