threedaymonk / htmlbeautifier

A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.
MIT License
325 stars 59 forks source link

Multi-line ERB tags get wrong formatting when the tags are misaligned #71

Open danielvlopes opened 2 years ago

danielvlopes commented 2 years ago

Hi there,

On our project, we'll often break our ERB tags into multiple lines to avoid long lines, and whenever an erb tag is not indented properly in the parent HTML tag, when htmlbeautifier is triggered, it will fix the opening of the tag but leave the following lines untouched, creating a misaligned tag.

Is this the expected behavior? Here's a GIF showing the scenario:

CleanShot 2022-05-19 at 10 37 48

Thank you.