Open marcodicro-dp opened 1 month ago
python --version
djlint --version
The formatter is adding an extra space inside a literal inside a js script, even if format_js is false.
Configuration
{ "profile": "django", "max_blank_lines": 2, "max_line_length": 100, "indent": 2, "close_void_tags": true, "format_attribute_template_tags": false, "format_css": false, "format_js": false }
File original contents (summarized)
{% block body %} <script> function fillValue(bulk_updatable_values, field, csvFileData) { if (bulk_updatable_values[field]) { csvFileData.push(`\<values:${bulk_updatable_values[field].join(",")}\>`); } else { csvFileData.push(`\<fill_value\>`); } } </script> {% endblock %}
Reformatted file
{% block body %} <script> function fillValue(bulk_updatable_values, field, csvFileData) { if (bulk_updatable_values[field]) { csvFileData.push(`\<values:${bulk_updatable_values[field].join(",")}\>`); } else { csvFileData.push(`\<fill_value \>`); } } </script> {% endblock %}
Notice the extra space after fill_value inside the else statement
I expected the formatter to leave that js untouched. I also tested setting close_void_tags to true does not change the behavior.
System Info
python --version
): Python 3.9.18djlint --version
): djlint, version 1.34.1Issue
The formatter is adding an extra space inside a literal inside a js script, even if format_js is false.
How To Reproduce
Configuration
File original contents (summarized)
Reformatted file
Notice the extra space after fill_value inside the else statement
I expected the formatter to leave that js untouched. I also tested setting close_void_tags to true does not change the behavior.