#microformats 2018-05-28
2018-05-28 UTC
#
@super10extra Web屋さんに質問なんですけどmicroformatsって今使われてる技術なのか知りたい (twitter.com/_/status/1000898355902332928)
KartikPrabhu and gRegorLove joined the channel
#
gRegorLove tantek: nothing outstanding on https://github.com/microformats/microformats2-parsing/issues/6 afaict. It can be closed.

KartikPrabhu joined the channel
#
KartikPrabhu gRegorLove: do you know why the h-entry>properties>photo has the first thing as the URL here http://pin13.net/mf2-dev/?id=20180528013306025

[quinnvinlove], [cleverdevil], [Natris1979], [tantek], [jeremycherfas], tantek_ and barpthewire joined the channel
KartikPrabhu, ivc_, wakest, ben2, [jgmac1106] and [miklb] joined the channel
[jgmac1106], [miklb], [snarfed], tantek, [pfefferle], [tantek] and KartikPrabhu joined the channel
#
KartikPrabhu Zegnat: also that property should be in a "value" property not by itself I think

#
KartikPrabhu also should that also use the textContent algo with whitespace stuff?

#
KartikPrabhu depends on the whitespaces :P

#
KartikPrabhu because it triggers the get textContent part of the algo

#
KartikPrabhu in mfp2y I get u'value': u'\n \n '

#
KartikPrabhu err forget the "u"s

#
KartikPrabhu hmm down for me too

#
KartikPrabhu hmm

#
KartikPrabhu yeah I am not sure that the spec says that anywhere for u-*

#
KartikPrabhu I think it only got updated in p-* things

#
Zegnat “else get the textContent of the element after removing all leading/trailing whitespace and nested <script> & <style> elements” - https://web.archive.org/web/20180528014534/http://microformats.org/wiki/microformats2-parsing#parsing_a_u-_property

#
KartikPrabhu yeah no image replacement there

[cleverdevil] joined the channel
#
KartikPrabhu yeah, maybe mf2py is not removing whitespace there. not sure what is "expected"

#
KartikPrabhu it is a made up example

#
KartikPrabhu right

#
KartikPrabhu I think replacing the first u-photo with u-like-of should also do similar things?

#
KartikPrabhu that is a more "real" example

#
KartikPrabhu but now it is adding a value property

#
KartikPrabhu but not some string

#
KartikPrabhu not sure why "u-photo" behaves differently than "u-like-of" in php-mf2. that seems like a bug

#
KartikPrabhu aaronpk: microformats.org is down. Is that under your control?

#
KartikPrabhu ok filed issue https://github.com/indieweb/php-mf2/issues/176

#
KartikPrabhu haha yes me too

#
KartikPrabhu Zegnat: if it helps I have this https://github.com/kartikprabhu/mf2py/blob/30f29d72e0e1f88ddc7360ddde05d12d7cc4da0a/mf2py/dom_helpers.py#L53 in mf2py experimental

#
KartikPrabhu roughly both :P

#
KartikPrabhu I am doing the text collection stuff but then going more by my intuition than what WHATWG says (because I got confused)

#
Zegnat Currently breaking my head on step 4 of the inner text collection steps (https://html.spec.whatwg.org/multipage/dom.html#inner-text-collection-steps). If I am currently inspecting a Text node, how do I determine that it is “the last line of the block”? Also, what block does that even refer to? And I have to act differently if “it ends with a br element”? But a Text node is never ending with any sort of element!

#
KartikPrabhu yeah it is very non-local that way. You have to know the context of the surrounding stuffs

#
KartikPrabhu which is why I sort of ditched following it to the letter

#
KartikPrabhu my algorithm currently passes all the whitespace tests that aaronpk has, except #11 which is incorrect

#
KartikPrabhu incorrect in the tests

#
Zegnat Hmm. I wonder if I could base it on the browsers tests https://github.com/web-platform-tests/wpt/blob/master/html/dom/elements/the-innertext-idl-attribute/getter-tests.js

#
KartikPrabhu judas priest that is going to be hard

#
KartikPrabhu two pre things get a \n

#
KartikPrabhu no, i don't think so

#
KartikPrabhu what happens for <pre>stuffs</pre><span>

#
Zegnat And PRE is a block level element: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3

#
KartikPrabhu <sigh>

#
KartikPrabhu right now I am inclined to go with the second one :P

#
KartikPrabhu examples-based

#
KartikPrabhu much easier to do

#
KartikPrabhu lol!

#
KartikPrabhu I have no idea how to write specs. I might write up the algo I am using

#
Zegnat The one I wrote was mostly based on the way WHATWG writes their state machines, I find that to be a pretty clean style. https://wiki.zegnat.net/media/textparsing.html

#
KartikPrabhu I might have more or less the same algo

#
KartikPrabhu oh the one thing I did add was dropping HTML comments

#
KartikPrabhu mostly because the DOM thing that mf2py uses thinks of comments as strings with a subclass

#
KartikPrabhu do comments not count as "Text" node either?

#
KartikPrabhu aah ok then yes I needed to special case that for mf2py. Maybe I should add similar things for CDATA and all that

#
KartikPrabhu but XML is not a priority right now

#
Zegnat https://dom.spec.whatwg.org/#interface-comment - Comment is CharacterData, just like Text, but isn’t Text

#
KartikPrabhu aah

#
KartikPrabhu yes. but Comment is a subclass of NavigableString so I could special case that

#
Zegnat CDATA should be a subclass of Text. So really checking for Text should be enough, if you are working with DOM-spec compatible objects: https://dom.spec.whatwg.org/#interface-cdatasection

#
KartikPrabhu right, but we don't want CDATA to show up in the text either do we?

#
KartikPrabhu so I will have to special case that like Comment

#
KartikPrabhu hmmm

#
KartikPrabhu yeah CDATA is more of an XML thing

#
KartikPrabhu also browsers don't display CDATA do they?

#
Zegnat “CDATA sections can only be used in foreign content (MathML or SVG).” - https://html.spec.whatwg.org/multipage/syntax.html#cdata-sections

#
KartikPrabhu anyway not a priority right now ;)

#
KartikPrabhu eeek

#
KartikPrabhu I wonder if something breaks with embedded SVG

#
KartikPrabhu yeah

#
KartikPrabhu yeah

#
KartikPrabhu ok will attempt now to resolve the img-alt stuff in the spec

#
KartikPrabhu will put up the proposal on the issue and link here

#
KartikPrabhu at some point we would have to resolve all the text stuff floating around in the spec. where should images be replaced etc...

#
KartikPrabhu maybe it is resolved and I just need to put it in mf2py correctly

#
KartikPrabhu that's why we need BLOCKCHAIN ;)

#
KartikPrabhu no, BLOCKCHAIN should always be in all caps :P

vivus, KartikPrabhu, [jeremycherfas], [tantek] and [chrisaldrich] joined the channel; vivus left the channel
#
KartikPrabhu ok here is a proposal for changes to img parsing https://github.com/microformats/microformats2-parsing/issues/2#issuecomment-392608361

#
KartikPrabhu [tantek]: ^ please review

KartikPrabhu and [keithjgrant] joined the channel
webchat162 and KartikPrabhu joined the channel