#microformats 2017-05-24

2017-05-24 UTC
[chrisaldrich], [cleverdevil], tantek, KartikPrabhu, [tamaracks], barpthewire, [kevinmarks], adactio and [jemostrom] joined the channel
#
Zegnat
Alright, I might have found another language that disrupts the nominative/possessive/oblique classes for pronouns. See this table: https://en.wiktionary.org/wiki/h%C3%A4nt%C3%A4#Declension
#
Zegnat
I need to enable JS to post to the Microformats wiki?!
#
sknebel
captcha?
#
sknebel
or what for?
#
zegnat
edited /h-card-brainstorming (+930) "/* Pronouns */ Add my implementation, reason for deviating, and link to thought process."
(view diff)
#
sknebel
Zegnat++
#
Loqi
zegnat has 1 karma in this channel (50 overall)
#
Zegnat
Yeah, captcha
#
Zegnat
recaptcha even, so have to enable JS from external domain (google.com)
#
Zegnat
Spam bots create user pages on the wiki no problem, and I can’t add my pronoun work :p
#
Zegnat
Wow, and then apparently it didn’t save it as a section edit but as a page edit, so now I will have to go and fix things
#
zegnat
edited /h-card-brainstorming (+669) "Re-add what I accidentally deleted."
(view diff)
#
zegnat
edited /microformats2-parsing-brainstorming (+777) "/* Pronouns in different languages */ Add discussion about pronouns."
(view diff)
#
Zegnat
yeey, I did not mess up that last one
#
Zegnat
sknebel, would you mind lending me a minute and check out my addition to http://microformats.org/wiki/h-card-brainstorming#Pronouns ? I think the summary of my reasoning and the link to my “research“ is clear enough but a second set of eyeballs would be appreciated.
#
Loqi
h-card Brainstorming
#
sknebel
seems good
#
Zegnat
Not sure what the next step to this would be other than spamming people about adding their pronouns to their pages, preferably in my way
#
sknebel
make something that uses them
#
ben_thatmustbeme
makingthings++
#
Loqi
makingthings has 1 karma
#
Zegnat
That will require some thought, seeing as how almost my entire point is that there is no easily defined and computer parsable format for pronouns.
#
Zegnat
goes to put in some more thought
adactio joined the channel
#
sknebel
^^^ spam/vandalism
#
@rubygems
microformats (4.0.4): A Ruby gem to parse HTML containing one or more microformats and microformats2 and return a… https://rubygems.org/gems/microformats
(twitter.com/_/status/867388343209922561)
#
ben_thatmustbeme
oy, silly frozen strings coming from cli :/
#
ben_thatmustbeme
have to do 4.0.5 now
#
@rubygems
microformats (4.0.5): A Ruby gem to parse HTML containing one or more microformats and microformats2 and return a… https://rubygems.org/gems/microformats
(twitter.com/_/status/867394721861206019)
#
ben_thatmustbeme
there we go, now a test for frozen strings, shouldn't be a problem now
[sebsel] joined the channel
#
aaronpk
barnaby++ for adding bear and myself as approved code signers! https://github.com/indieweb/php-mf2/commit/9534363d8fe636a588d3dfb391fdd6c958e02632
#
Loqi
barnaby has 1 karma
tantek joined the channel
#
bear
barnaby++
#
Loqi
barnaby has 2 karma
#
aaronpk
we should do a release soon, lots of good new stuff in the php parser
#
Loqi
yea!
#
tantek
edited /Special:Log/block () "blocked [[User:Jsponselcellular]] with an expiry time of infinite (account creation disabled): Spamming links to external sites"
(view diff)
#
ben_thatmustbeme
whats been added?
#
aaronpk
last release was March last year
#
ben_thatmustbeme
so probably a lot
#
ben_thatmustbeme
also aaronpk, heh, github stripped out <base> from my comment
#
ben_thatmustbeme
that was confusing
#
aaronpk
oh yeah lol
#
tantek
apparently all your <base> belong to github, not your comments
#
aaronpk
working on release notes for the php parser
#
aaronpk
ben_thatmustbeme: can you look over https://github.com/indieweb/php-mf2/pull/113
#
Loqi
[gRegorLove] #113 Fix parsing of "value" for nested microformats when not a property
#
ben_thatmustbeme
aaronpk: i can't speak to the parser change, but the test changes look correct to me
rodolfojcj joined the channel
#
aaronpk
i wanna get a few more easy issues into this release
#
ben_thatmustbeme
at some point i want to loop over all that test suite for all the parsers and compare results
#
aaronpk
i *think* these are all bugfixes so this will be 0.3.1 rather thamn 0.4.0
#
aaronpk
why are there a bunch of checks for whether getAttribute returns null
#
tantek
aaronpk, may be because attribute non-existence vs attribute=""
#
aaronpk
looks like getAttribute will return an empty string if the attribute doesn't exist
#
aaronpk
checking hasAttribute instead was the fix for the img alt issue https://github.com/indieweb/php-mf2/pull/90/files
#
Loqi
[Tantek Çelik] microformats2 parsing specification
#
aaronpk
is `if a.u-x[href]` meant to test the existence of the href attribute or whether the value is non-empty?
KartikPrabhu joined the channel
#
aaronpk
oh jeez
#
aaronpk
this whole u- parsing section is only working by coincidence
gRegorLove joined the channel
#
ben_thatmustbeme
is glad he specifically did not look at any other parsers when rewriting his
#
tantek
aaronpk, "only working by coincidence" implies you could design a simple test that parser would fail that others would pass?
#
ben_thatmustbeme
i think its more like "all this code is useless and it works but by some other unintentional method"
#
aaronpk
i believe i can create a failure case yes
#
aaronpk
there aren't tests for <a href="" class="u-url"> for example
#
aaronpk
(empty href attribute)
#
aaronpk
but, spec parsing question: does "if a.u-x[href]" mean "if there is an href attribute"? because that should be made more explicit if so
[shaners] joined the channel
#
[shaners]
How did this ever work?™
#
Zegnat
aaronpk that should mean existence, including empty ones, I think. Much like yesterday's discussion on empty alt values
#
aaronpk
`$u->getAttribute('href') !== null` -- getAttribute never returns null
#
[shaners]
Ruby / Rails have methods like .blank? and .present? which check for nil, empty string/array/hash/etc. Does PHP have something similar?
#
aaronpk
there's hasAttribute too
#
aaronpk
i believe all these checks should actually be checking whether the attribute is present
#
aaronpk
this is admittedly a contrived example, but: http://pin13.net/mf2/?id=20170524172509882
#
[shaners]
Rule 34.1: If you can contrive it, someone will code it for real in the wild.
#
aaronpk
the ruby parser does not return the url value https://microformats-parser-ruby.herokuapp.com/submissions/3
#
aaronpk
which is correct?
#
tantek
[shaners] if only, plenty of things are contrived at W3C which are never coded for real in the wild
#
[shaners]
34.1.a Unless it’s in a spec. ¯\_(ツ)_/¯
#
tantek
*even* in specs :sadface:
#
tantek
this is why I had to work on explicit process for "obsoleting" W3C specs.
#
tantek
because there are so many that are completely disconnected from anything "real in the wild"
#
aaronpk
okay but back to business
#
tantek
aaronpk in that example the data element p-* parsing should get the URL "" from the explicit value=""
#
aaronpk
so both are wrong
#
ben_thatmustbeme
so href="" is just href="<current url>" is it not?
#
ben_thatmustbeme
ruby parser ignores it if it doesn't know the current url
#
tantek
and yeah "p-url" should be something that validator issues a STRONG WARNING about
#
ben_thatmustbeme
at least that was the plan
#
tantek
as in, you really don't want to use p-* with something URL like
#
aaronpk
okay yeah let me do this with something not called url
#
tantek
because p-* does zero relative URL handling
#
ben_thatmustbeme
oh, i see what you were talking about
#
aaronpk
the parsed result should have a content property that is an empty string, right?
#
[shaners]
Are empty strings meaningful?
#
aaronpk
in the case of u- attributes they definitely are
#
[shaners]
I mean in final output JSON.
#
[shaners]
Is an attr with an empty string the same as a non-existent attr?
#
[shaners]
From the perspective of the JSON consumer.
#
KartikPrabhu
mf2py gives url=""
#
KartikPrabhu
[shaners]: no I think it says that the author explicitly set it to empty string instead of not specifiying
#
KartikPrabhu
also, it can be used to stop implied parsing of p-name for instance
#
aaronpk
i believe the ruby one is correct in that one
#
KartikPrabhu
how did the php one get "example.com" ?
#
tantek
yes explicit empty strings are the text equivalent of explicit 0 instead of undefined
#
[shaners]
where is example.com coming from in that one?
#
aaronpk
it's resolving the empty string relative to the base URL
#
[shaners]
oh right
#
aaronpk
because in `$u->getAttribute('href') !== null` , getAttribute will never be null
#
Loqi
[Tantek Çelik] microformats2 parsing specification
#
aaronpk
that's what i thought
#
tantek
aaronpk yes in http://pin13.net/mf2/?id=20170524173032485 should have "content": [""]
#
KartikPrabhu
so mf2py gives url="what happens here"
#
ben_thatmustbeme
if you did url=""
#
ben_thatmustbeme
oops, href=""
#
ben_thatmustbeme
the ruby one should use the relative base
#
aaronpk
switching these to hasAttribute instead of getAttribute !== null fixes it, so i'm going to PR that
#
Loqi
[dissolve] #72 blank value not returning blank string
#
aaronpk
a rel value of an empty string is valid, right?
#
aaronpk
oh wait no it's not
#
ben_thatmustbeme
so when i make that change, this breaks
#
ben_thatmustbeme
<hr class="p-honorific-suffix" /> returns a "" for its value
#
aaronpk
the php one does too
#
ben_thatmustbeme
i guess thats correct then, and the test suite's result it wrong?
#
aaronpk
it depends on whether HTML says that element has textContent of ""
#
ben_thatmustbeme
not much i can do to change that bit, since thats part of the nokogiri lib
#
Loqi
[aaronpk] #119 Fixes for elements with missing attributes (#118)
#
ben_thatmustbeme
https://dom.spec.whatwg.org/#dom-node-textcontent says for Elements textCotent must be The concatenation of data of all the Text node descendants of the context object, in tree order.
#
ben_thatmustbeme
but it doesn't say what to do if there are no text node descendants
#
ben_thatmustbeme
asks in #whatwg
#
aaronpk
well that was fun
#
aaronpk
will wait for gRegorLove to review, then I want to publish a new release
#
ben_thatmustbeme
so according to <Domenic>, the textContent is empty string
#
ben_thatmustbeme
from #whatwg
#
aaronpk
i feel like that should be made explicit in the html spec
#
gRegorLove
catches up
#
ben_thatmustbeme
well DOM spec
#
gRegorLove
Ooh, do you have signing rights now aaronpk?
#
ben_thatmustbeme
<Domenic> ben_thatmustbeme: in general it's understood that the concatenation of an empty set of strings is the empty string; I guess we could eventually define that explicitly, but it's generally true in programming.
#
tantek
I suppose the concatenation coerces to a string result rather than a null result
#
Loqi
[aaronpk] #120 parse poster attribute for video tags
#
gRegorLove
119 looks good to me
#
ben_thatmustbeme
checks in php and ruby
#
ben_thatmustbeme
implode([]) => ""
#
ben_thatmustbeme
[].join() => ""
#
ben_thatmustbeme
so that would mean the test suite is incorrect there
#
ben_thatmustbeme
that was quite the little rabbit hole to go down there
#
aaronpk
gRegorLove: 120 is expected to fail until 119 is merged
#
gRegorLove
Oops, totally missed that line.
#
gRegorLove
Ok, looks good to me
#
aaronpk
thats whast led me down this whole rabbit hole to begin with
#
aaronpk
i saw that i wouldn't be able to add support for the poster attribute withotu fixing the getAttribute check
#
gRegorLove
aaronpk++
#
Loqi
aaronpk has 8 karma in this channel (1325 overall)
#
ben_thatmustbeme
microformats cli comes in handy again for writing test results
#
ben_thatmustbeme
microformats sample.html > sample.js
#
ben_thatmustbeme
then just edit the file to correct for what the output is supposed to be
[shaners] joined the channel
#
[shaners]
ben_thatmustbeme++
#
Loqi
ben_thatmustbeme has 14 karma in this channel (224 overall)
#
ben_thatmustbeme
feel like i'm releasing too often when i'm releasing for each of these little fixes
#
[shaners]
meh. there’s penalty in lots of bug fix releases.
#
[shaners]
no sense in holding one/some back just because there was recently a release.
#
[shaners]
I say release when stuff is ready
#
ben_thatmustbeme
fine then, 4.0.6 is on its way
#
@rubygems
microformats (4.0.6): A Ruby gem to parse HTML containing one or more microformats and microformats2 and return a… https://rubygems.org/gems/microformats
(twitter.com/_/status/867457460348628992)
gRegorLove_, gRegorLove, [barryf], cheim and [cleverdevil] joined the channel