You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Description
When using ZED with a Django project, saving a template file like the following:
{% extends "base.html" %}
{% block title %} Certificate List {% endblock %}
{% block content %}
<select name="consignatario__pais" id="consignatario__pais" class="form-control select2" required style="width: 100%">
<option value="">Select a country</option>
{% for pais in paises %}
<option value="{{ pais.id }}" {% if consignatario_pais == pais %} selected {% endif %}>{{ pais.nombre }}</option>
{% endfor %}
</select>
{% endblock %}
Results in the following unwanted transformation after saving:
{% extends "base.html" %}
{% block title %} Certificate List {% endblock %}
{% block content %}
<select
name="consignatario__pais"
id="consignatario__pais"
class="form-control select2"
required
style="width: 100%"
>
<option value="">Select a country</option>
{% for pais in paises %}
<option
value="{{ pais.id }}"
{%
if
consignatario_pais=""
="pais"
%}
selected
{%
endif
%}
>
{{ pais.nombre }}
</option>
{% endfor %}
</select>
{% endblock %}
Impact of the Issue
The {% if consignatario_pais == pais %} statement is rewritten incorrectly, introducing errors and breaking the template logic.
Additionally, unnecessary line breaks are added, which breaks the django template system, and of course also impact readability and code maintainability.
Additional Details
Uninstalling the responsible extension (HTML) solves the problem only temporarily, as it is automatically reinstalled when restarting ZED. Should this behavior be reported as a separate bug, or is it part of the same issue?
Steps to Reproduce
Open a Django project in ZED.
Edit a template file like the provided example.
Save the changes.
Observe how the code is automatically transformed.
Undo the changes
Uninstall HTML extension
Save again (now there are no modifications)
Close the app, restart the computer (I'm not 100% sure this part happens every time you restart the computer)
JosephTLyons
added
html
HTML markup support
setting
Feedback for preferences, configuration, etc
support
User support (non-defect troubleshooting, documentation, etc)
and removed
bug
[core label]
triage
Maintainer needs to classify the issue
admin read
Pending admin review
labels
Jan 24, 2025
Check for existing issues
Describe the bug / provide steps to reproduce it
Problem Description
When using ZED with a Django project, saving a template file like the following:
Results in the following unwanted transformation after saving:
Impact of the Issue
The {% if consignatario_pais == pais %} statement is rewritten incorrectly, introducing errors and breaking the template logic.
Additionally, unnecessary line breaks are added, which breaks the django template system, and of course also impact readability and code maintainability.
Additional Details
Uninstalling the responsible extension (HTML) solves the problem only temporarily, as it is automatically reinstalled when restarting ZED. Should this behavior be reported as a separate bug, or is it part of the same issue?
Steps to Reproduce
Zed Version and System Specs
Zed: v0.168.2 (Zed)
OS: macOS 14.6.1
Memory: 8 GiB
Architecture: aarch64
If applicable, add screenshots or screencasts of the incorrect state / behavior
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
The text was updated successfully, but these errors were encountered: