microformats / h-card

This repository is for tracking and resolving issues related to the h-card specification http://microformats.org/wiki/h-card
6 stars 2 forks source link

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

Open mlncn opened 3 years ago

mlncn commented 3 years ago

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 commented 3 years ago

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)

jalcine commented 2 years ago

I do think this is safe to close as it's documented by the IETF with a URI scheme. I use that format at https://jacky.wtf/contact for my public phone number.

(Originally published at: https://jacky.wtf/2022/3/Ql/Qlm4OG_akLcGmsyb6GsGSUmn)