#microformats 2018-05-26

2018-05-26 UTC
[cleverdevil], [jgmac1106], [tantek], [Natris1979], tantek_, toomim, [dougbeal], tantek, barpthewire, KartikPrabhu, [chrisaldrich], tae and [quinnvinlove] joined the channel
#
@jgmac1106
Okay @cogdog used this: https://html5up.net/ to build Dimensions. Pretty neat. 100% incompatible with microformats2 plug-in, but it is built using a http://skel.io framework so yeah for CSS Grid. Fun digging through this stuff. (https://jgregorymcverry.com/2911-2/)
(twitter.com/_/status/1000356522323599360)
#
@jgmac1106
Okay so looking at @cogdog’s dimension a bit more it meant to be a business card, a portfolio directory. I think an h-card and h-entry are going to be easier to add. Going to turn my attention to Hueman after that. Seems to leave some microformats kruff… https://jgregorymcverry.com/2913-2/
(twitter.com/_/status/1000360710474366976)
[kevinmarks], [kim_landwehr], Kyle-K, barpthewire, jalcine, [miklb], [cleverdevil] and [grantcodes] joined the channel; Kyle-K left the channel
#
KartikPrabhu
!tell [kevinmarks] Is it possible that I get permissions to close and label issues on the mf2py main repo?
#
Loqi
Ok, I'll tell them that when I see them next
#
KartikPrabhu
Zegnat: do you actively use mf2py as your parser?
#
Zegnat
I don’t. Mosty PHP-land over here
#
KartikPrabhu
Zegnat: here is an issue in any case https://github.com/microformats/mf2py/issues/104 not related to actual parsing but some mf2py quirk
#
Loqi
[kartikprabhu] #104 backcompat parsing changes original document
#
Zegnat
ooo, parsing quirks
#
Zegnat
heads on over
#
KartikPrabhu
more like an mf2py quirk while implementing backcompat
#
Zegnat
I wonder if php-mf2 has the same problem
#
KartikPrabhu
yeah I don't speak PHP
#
KartikPrabhu
but php-mf2 also does class subsitutions
#
Zegnat
I think most people are passing in an HTML string and getting parsed mf2 out, so they can’t run into this.
#
Zegnat
But if you pass in a DOMDocument to the PHP parser, and then try to use the DOMDocument object again after parsing these same issues might occur.
#
KartikPrabhu
yeah that seems reasonable. I haven't run into this in practice either
#
Zegnat
Would need to test. Filing bug. Not something I want to start testing past 11pm :P
#
KartikPrabhu
maybe file bug after testing :P
#
Zegnat
Neh. Bugs don’t cost anything. Either someone beats me to testing, or I test it tomorrow.
[chrisaldrich] joined the channel
#
Loqi
[Zegnat] #174 Do we change the DOMDocument instance that get passed in, and is this an issue?
#
Zegnat
goes back to sipping his G&T
#
gRegorLove
Yeah, php-mf2 does similarly: http://pin13.net/mf2/?id=20180526223157419 though it does it on the properties too, not just the hentry
#
KartikPrabhu
gRegorLove: This is not for the parsed content.html Does php-mf2 change the original "DOMDocument" that the users gives it?
#
gRegorLove
Ah, let me check.
#
KartikPrabhu
I have fixed the content.html thing for mf2py very recently (yesterday)
#
KartikPrabhu
so in mf2py running parse a second time on the same "DOM" object gives wrong results
#
gRegorLove
I'll have to check how you did that
#
KartikPrabhu
gRegorLove: https://github.com/kartikprabhu/mf2py/blob/experimental/mf2py/backcompat.py#L49 basically I attach a copy of the original element if the replaced class has any "e-*". Then in the "e-*" parsing it uses the original instead of the modified one ;)
#
gRegorLove
Confirmed if you pass in a DOMDocument to php-mf2 it's changed after parsing.
#
KartikPrabhu
ok. don't know if that is good or bad yet. In php-mf2 it might not be an issue since the whole DOM is changed to mf2
#
gRegorLove
Including the children, though, so a second pass shouldn't (I think) cause problems
#
KartikPrabhu
I might have preemptively overoptimised :|
#
gRegorLove
Sounds like php-mf2 should definitely copy the DOMDocument and work on that
#
KartikPrabhu
right if the backcompat rule that "ignore mf1 if mf2 is present" is used then it won't be an issue in second pass
#
KartikPrabhu
I am also in favour of not changing things the user passes in explicitly
#
KartikPrabhu
in mf2py that might need some funny code since BeautifulSoup does not support "deepcopy" i.e. making a separate duplicate
#
gRegorLove
Yeah, I'm wondering if PHP is similar. I wouldn't have expected it to change the input DOMDocument since it's not by reference, but maybe it's a special case
#
KartikPrabhu
I suspect it is by reference since it is some object or something
#
KartikPrabhu
that is what happens in python
#
KartikPrabhu
(sometimes)
#
gRegorLove
Yeah, looks like object references don't contain the object, just the identifer so accessors can find it.
#
KartikPrabhu
yeah. OOPs!
#
gRegorLove
Appears to be simple fix in PHP, `$doc = clone $input;`
[cleverdevil] joined the channel
#
KartikPrabhu
oh hey! I can make deepcopies of the whole doc too! just not of the elements :P
#
gRegorLove
Huh, interesting
#
KartikPrabhu
It depends on which objects have "deepcopy" methods or something
#
gRegorLove
For PHP it's a shallow copy apparently.
[grantcodes] joined the channel
#
KartikPrabhu
hmm deepcopy works in my console but not in mf2py tests! WTF
KartikPrabhu joined the channel