Open mjnaderi opened 2 years ago
When formatting a CSS file with django template tags or an HTML file which contains django template inside <style> tag, styles are not formatted correctly.
<style>
The code looked like this before beautification:
<style> {% if condition %} .important {color: red} {% else %} .important {color: blue} {% endif %} </style>
The code should have looked like this after beautification:
<style> {% if condition %} .important { color: red } {% else %} .important { color: blue } {% endif %} </style>
The code actually looked like this after beautification:
<style> { % if condition % } .important { color: red } { % else % } .important { color: blue } { % endif % } </style>
npm install js-beautify ./node_modules/js-beautify/js/bin/js-beautify.js --type html --templating django file.html # - OR - ./node_modules/js-beautify/js/bin/js-beautify.js --type css --templating django file.css
OS: Linux
Yup. The CSS beautifier is the crustiest part of this product. Contributors needed.
Description
When formatting a CSS file with django template tags or an HTML file which contains django template inside
<style>
tag, styles are not formatted correctly.Input
The code looked like this before beautification:
Expected Output
The code should have looked like this after beautification:
Actual Output
The code actually looked like this after beautification:
Steps to Reproduce
Environment
OS: Linux