Skip to content
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

Recommended approach to more human-readable and more machine-readable phone numbers? #2

Open
mlncn opened this issue Sep 17, 2021 · 1 comment

Comments

@mlncn
Copy link

@mlncn mlncn commented Sep 17, 2021

Take:

<a class="p-tel" href="tel:13334443483">(333) 444 FIVE</a>

Ideally in this scenario the h-card parser would take the number from the href tel, but i don't think that's what happens. Is it recommended to do the actual h-card markup in a hidden div or span and put the most-preferred format there (<span class="p-tel hidden>+13334443483</span> in this example)?

(Working on the Microformats Drupal module!)

@tantek
Copy link
Member

@tantek tantek commented Sep 19, 2021

This is precisely what the microformats2 "u-" property prefix is for, to instruct the parser to retrieve and parse for URL-like information from an element, from its URL-related attribute if any, and text content as a fallback, including relative URL resolution if applicable. E.g. in the example you gave, try u-tel instead of p-tel:

<a class="u-tel" href="tel:13335553483">(333) 555 FIVE</a>

If that works as desired, go ahead and close this issue.

(Originally published at: https://tantek.com/2021/261/t1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants