-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add block list for known conflicting root class names #211
Conversation
This should be behind a flag IMHO. |
Or should there be a flag to turn it off? It'll do only good right now and if someone somewhere wants to experiment with e.g. |
I strongly believe default behavior of microformats parsers should be as similar as possible. Parser bugs already regularly cause confusion when someone checks their pages with one parser and then is confused why an application using a different parser does not understand it correctly. |
Agreed, I think it should be behind a flag and (probably) configurable, like an option to initialize the parser with a custom list of class names to block. This would allow a specialized app like indiewebify.me to choose to ignore any conflicting classes that arise over time, without requiring an update to the list of static class names in the parser. |
@sknebel @gRegorLove what's a good flag? leave the tailwind-specific classes out of the library entirely and just let the user bring their own block list?
|
If it's behind a flag I don't have a strong opinion about including Tailwind classes in the package. If you do, maybe it could have three states:
|
One way might be to have the list be user-provided, but have a ready-to-use list as a constant available. |
`filter_roots` defaults to False. Set to True to filter known conflicting Tailwind classes. Otherwise provide a collection of custom classes to filter.
It's tempting to try to leverage this function https://github.com/microformats/mf2py/blob/main/mf2py/mf2_classes.py#L9 but it wasn't the right place to reject items. As implemented, this method will only work on root ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems worth experimenting with a flag as commenters have said. LGTM.
Closes #170.
I'm seeing
h-px, h-auto, h-full, h-screen, h-min, h-max, h-fit
in the Tailwind docs. None of these seem to be good candidates for root class names so there shouldn't be an issue of vocabulary gatekeeping.The general feeling I get from microformats/microformats2-parsing#59 is that parser experimentation would be a good path forward. This change can easily be reverted at a later date.
In the meantime we have a fix for the current landscape and a framework for solving similar issues moving forward.