Closed ph-dev-2016 closed 7 years ago
@ph-dev-2016 Can you add a small code snippet that shows the bug? I'm not able to reproduce.
I included a code snippet, but for some reason Github does not show the text correctly.
If this is a line in my Django template file before save
<img src="{% static "mysapp/site_icon.png" %}" alt="site_icon" style="width:64x;height:64px;" />
in save it becomes (extra spaces in the static file name in quotes)
<img src="{% static " mysapp/site_icon.png " %} " alt="site_icon" style="width:64x;height:64px;" />
The problem is that your snippet is not really html. From a HTML perspective, the src attribute ends with the first quote: src="{% static "
. mysapp/site_icon.png
is considered the second attribute.
The formatter decides to separate the attributes with a space.
You'd need a proper formatter for Django that takes the templates into account.
Steps to Reproduce:
Because of this the image file is not found when I browse the site This step3 is the bug.
If I save from menu File/Save, then this img tag is NOT reformatted. So it works differently depending on whether you save from CTRL-S or from File menu.