Open UnknownPlatypus opened 1 month ago
I'm neutral on this, so I'm going to leave it open for discussions.
For context this is tracked more generally in prettier too Format values of attributes with defined semantics and led to the formatting of class
and style
attributes.
I've also done some research for other good candidates from the HTML attribute list (cross referencing the HTML spec) and found the followings that could be formatted space-separated like class
:
rel
on "form", "a", "area", "link"
autocomplete
on "form", "input", "select", "textarea"
sandbox
on "iframe"
accept-charset
on "form"
aria-labelledby
, aria-describedby
, aria-controls
and aria-owns
on any elementQuick searches using https://sourcegraph.com/search found matches with weird spaces for all of them so I suppose it could benefit some people.
The html
accept
attribute expect a comma separated list of string. This is easy to normalize the same way we normalizeclass
as a space-separated list of string so I went for it.This could possibly be expanded to other attribute with defined semantics (See https://github.com/g-plane/markup_fmt/pull/40#issuecomment-2273030728).