-
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
Update validate-h-card #101
Conversation
Now using the mf-cleaner's getRepresentativeHCard method.
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.
Nice typographical updates as well as cleaning up some logic!
I need to push a small change before this is ready. The second condition (no rep h-card, 1 or more h-cards found) is always saying "Multiple h-cards were found...". I'll make it say "An h-card was found..." if there's only one. |
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.
from reading the diffs, these look like many good improvements. now we just need (regression) tests :)
Any possibility we can merge this? I'm not sure how to set up unit tests with this older framework to mock requests. The test links above demonstrate the different states and most of the changes are actually in the mf-cleaner dependency. |
I'm feeling pretty confident about this so going to merge with the two approvals. We can work on implementation tests going forward, particularly after #82. |
This resolves #99 and streamlines a few things on the /validate-h-card page:
getRepresentativeHCard
method instead of duplicating the rep h-card code inlineif ($error)...
andif ($showResult)...
getPlaintextArray
to parse multi-value mf2 properties for display<label>
for accessibility, addedrequired
attributeisset
and null coalescing operatorYou can test these updates on https://iwm.gregoreatworld.com/validate-h-card/
The URL from #99 is working with these updates:
https://iwm.gregoreatworld.com/validate-h-card/?url=https%3A%2F%2Fpresence-gqle9t8ex-johanbove.vercel.app%2F
Edit: contextualized the message when there's no rep h-card, but one or more h-cards: