djLint icon indicating copy to clipboard operation
djLint copied to clipboard

[FEATURE] Alpinejs x-data field is condensed to a single line

Open pinkfrog9 opened this issue 2 years ago • 11 comments

For example, the following code, image

After formatting becomes this: image

Is there some mechanism to format the js inside x-data field. If not, is it possible to disable the format on x-data?

pinkfrog9 avatar Jul 21 '23 23:07 pinkfrog9

Thanks for opening your first issue here!

welcome[bot] avatar Jul 21 '23 23:07 welcome[bot]

Thanks! Is it always "real" js or is there sometimes template syntax? I'm using the python version of js beauty here and it can only handle real js. We can probably add flags for both though.

christopherpickering avatar Jul 22 '23 22:07 christopherpickering

Thanks! Is it always "real" js or is there sometimes template syntax? In my use case, I use jinja2 + alpine.js. So the x-data can contain jinja template.

pinkfrog9 avatar Jul 22 '23 22:07 pinkfrog9

is there a way do disable the formatting inside the ticks for html attributes?

scratchmex avatar Jul 29 '23 19:07 scratchmex