rehype-minify-enumerated-attribute
: support more complex match conditions?
#39
Labels
🗄 area/interface
This affects the public interface
💪 phase/solved
Post is done
🧒 semver/minor
This is backwards-compatible change
🦋 type/enhancement
This is great to have
Subject of the feature
Copied from #36 (comment)
Additionally, I wonder if it would make sense to add additional information to address the caveat you noted in your comment for attributes like
inputMode
(where they only apply to elements with either a) presence of an attribute or b) an attribute set to a certain value):Eg. either changing
tagNames
toselectors
and allowing a value like['input[type="text"]', 'input[type="search"]', 'input[type="password"]']
, or adding an additional field liketagMatcher
, which could allow a more powerful approach like a function ((el) => /text|search|password/.test(el.type)
). I suppose the law of least power would suggest something closer to the first approach though.Problem
Some attributes apply to only elements with some "matching condition" as explained above (eg. the
inputMode
applies only to someinput
elements, not all of them)Expected behavior
This information could be in the data provided.
Alternatives
The text was updated successfully, but these errors were encountered: