nebulab / erb-formatter

Format ERB files with speed and precision
MIT License
135 stars 22 forks source link

Format unquotted attributes adding quotes to already quoted attributes #42

Closed IbraheemTuffaha closed 6 months ago

IbraheemTuffaha commented 7 months ago

The newest release of v0.7.1 by @x4d3 introduced format unquoted attributes. In some cases, it's adding quotes to attributes that already have quotes, check the image below 👇

image

Seems to me like a weird edge case that needs to be handled.

phil-janeapp commented 7 months ago

To add some additional context, it appears to be happening on attributes that contain an = sign and are of at least a certain length (somewhere in the 50-60 character range?). I was able to have it happen on <a> tags but only if the URL was of a certain length.

mikker commented 6 months ago

Happens for this line as well:

- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
+ <meta name="viewport" content=""width=device-width, initial-scale=1.0, maximum-scale=1.0"">