djlint / djLint

✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
https://djLint.com
GNU General Public License v3.0
664 stars 81 forks source link

[FEATURE] Better indentation for hash parameters on multiple lines #842

Open lukepass opened 2 months ago

lukepass commented 2 months ago

Feature Request

I would like that hash parameters were better indented in Twig templates.

Now:

{{ form_start(form, {
                    attr: {
                    class: 'quiz',
                    'data-controller': 'ajax-form quiz',
                    'data-ajax-form-targets-value': ['#ajax-content-1', '#ajax-content-2', '#lesson-footer']|serialize('json') ,
'data-ajax-form-spinner-html-value': include('shared/_spinner.html.twig'),
'data-ajax-form-scroll-to-value': '#ajax-content-1',
}
}) }}

Desiderata:

{{ form_start(form, {
    attr: {
        class: 'quiz',
        'data-controller': 'ajax-form quiz',
        'data-ajax-form-targets-value': ['#ajax-content-1', '#ajax-content-2', '#lesson-footer']|serialize('json') ,
        'data-ajax-form-spinner-html-value': include('shared/_spinner.html.twig'),
        'data-ajax-form-scroll-to-value': '#ajax-content-1',
    }
}) }}

Thank you for the good project"