#microformats 2020-10-16

2020-10-16 UTC
[fluffy], [chrisbergr], [mapkyca], iwaim_, [jgmac1106], [tw2113_Slack_], [chrisaldrich], [jeremycherfas], [schmarty], [Yenly_Ma] and btrem joined the channel
#
btrem
I have a mf 2 question: markup for an email address in a link is<a class="u-url" href="foo@example.com">foo@example.com</a>What is the correct markup for an email address that is /not/ in a link? I use<span class="p-email">foo@example.com</span>Should I still use u-url? What are the parsing rules for u-* elements where there's no href attribute?
#
aaronpk
you'd probably want mailto:
#
Loqi
aaronpk: Zegnat left you a message 1 week, 1 day ago: can we make Loqi link to https microformats.org, now that we have a cert? I clicked on a link and was surprised that I was not logged in.
#
aaronpk
otherwise clicking that link would attempt to log in to example.com with the username "foo"
#
btrem
whoops, typo. Yes, that should be <a class="u-url" href="mailto:foo@example.com">foo@example.com</a>
#
aaronpk
you'd need href="mailto:foo@example.com"
#
btrem
But I'm wondering about cases where I don't use <a/> markup? Do I use 'p-url'? Or 'u-url'? I currently use p-*, but it's unclear (to me, at least), which is correct.
#
aaronpk
try putting just "foo@example.com" into a link and clicking it
#
aaronpk
it won't do what you want :)
#
aaronpk
the prefixes tell the parser where to get the value from
#
aaronpk
u- means get the value from the href or src attribute
#
btrem
In that case, I'm correct to use <span class="p-email">foo@example.com</span>
[KevinMarks] joined the channel
#
btrem
I guess the next question is, what do parsers do with it? I suppose for now, it doesn't matter, since (ISTM) Google et. al. only use mf 1.0 classnames,
#
aaronpk
you can do that with a span yeah
#
aaronpk
there's lots of consumers other than google :)
#
aaronpk
the prefixes are parser instructions, and they are dropped by the time something is consuming the parsed version
#
[KevinMarks]
Parsers put it into a structure and strip the prefixes, so you would get a different result
#
aaronpk
you can see this by testing the markup in a parser like https://php.microformats.io
#
btrem
@KevinMarks Not sure I understand you. Is p-url preferable to u-url when there's no <a/> markup?
#
aaronpk
it's not a preference, it's a parsing rule
#
btrem
I get that. Which is the better markup? Which will get a parser to take the element content as the email?
#
aaronpk
take a look at my example
#
btrem
I just did, thanks.
#
[KevinMarks]
I meant that if you use a mailto: in the url the parser will copy that in
[tw2113_Slack_], KartikPrabhu and [chrisbergr] joined the channel