-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore Tailwind's h- prefixes #59
Comments
If we go with the third option, I'd be slightly pressing the suggestion to parsers to allow for an option to restrict any of the This could be an evolving list, which is already done with Micropub extensions and new specifications of objects themselves. This also could break backcompat with those parsers that fallback to being a (Originally published at: https://jacky.wtf/2022/11/9QFM) |
As the list of tailwind-specific false-positive root classnames is short and knowable, it’s possible to take parsed mf2 output and restructure it as if the false positives had not been there. This is then available as a customisable post-processing step which consumers can choose to do, or not. There’s a draft implementation here https://github.com/barnabywalters/php-mf-cleaner/blob/main/src/functions.php#L629 (relevant test here for reference) |
@barnabywalters Thank you for sharing your draft implementation! I would be in favour of collating a whitelist of all accepted microformats values, rather than ignoring tailwind-specific values. If tailwind adds new attributes, we will need to release new versions of all parsers, which is an external decision made by the tailwind team. I don't think we should be reactive to external tools that use the |
The generic parsing of vocabularies is a key feature of microformats2 and improvement from mf1, so I don't think an allowlist can be part of the core parsers. |
@gRegorLove Thanks for sharing! Do you think we should take any action on this at the parser spec level? |
I don't see an immediately obvious way to. Most of the Tailwind height selectors have numbers (
It's those handful like |
It'd be interesting to experiment with user-provided filtering inside the parser (in many ways easier than trying to save it in post-processing), but I'm wary of adding this to the spec without extensive experimentation. |
Copied from mf2py issue 170.
Tailwind is a CSS framework that uses h- prefixed values for styling, specifically height.
Therefore, the following example won't parse well in any correct implementation of microformats2.
The options for dealing with this seem to be:
h-[0-9]*
but we could also the otherh-
properties used by TailwindGiven Tailwind doesn't seem to be going away, and given priority of constituencies ("consider users over authors over implementors over specifiers over theoretical purity"), the third option may be the least bad, even if it does make parsing marginally more complicated.
The text was updated successfully, but these errors were encountered: