#microformats 2018-04-02
2018-04-02 UTC
j12t, KevinMarks_, KartikPrabhu and tantek joined the channel
# KartikPrabhu yup
# KartikPrabhu i'm having a lot of trouble with <pre>
tantek joined the channel
# KartikPrabhu drive safe
# Zegnat Planning to pull https://github.com/aaronpk/microformats-whitespace-tests for automatic testing. So if anyone has time to write some tests with <pre> there, that would help a lot!
tantek, KevinMarks, j12t, barpthewire, KevinMarks_, davy__, sebsel and webchat254 joined the channel
Garbee joined the channel
# aaronpk wow, all except the PHP parser get this one right https://github.com/aaronpk/microformats-whitespace-tests/blob/master/tests/10.html
# aaronpk KartikPrabhu: is there a python parser more up to date than https://python.microformats.io/ ?
# Zegnat aaronpk, try https://kartikprabhu.com/connection/mfparser
# KartikPrabhu aaronpk: my parser only does HTML imput
# KartikPrabhu hmm it will inside the page.
# KartikPrabhu yes
# KartikPrabhu aah you want to automate it :P
# KartikPrabhu now doesn't even remember how he set this up
# aaronpk so these are separated by \n\n in the plaintext https://github.com/aaronpk/microformats-whitespace-tests/blob/master/tests/9.html
# Zegnat https://html.spec.whatwg.org/#dom-innertext - is not fun... I am not even sure I understand all of the steps, because I am not well acquanted with CSS specs.
# aaronpk okay in the mean time here are some new ones https://pin13.net/mf2/whitespace.html
# KartikPrabhu yeah <pre> is a pain! I tried a lot yesterday to make some sane function to handle <pre> but all failed :(
# Zegnat All of that text handling is handled by a single step in the WHATWG spec, which is mind-boggling: https://html.spec.whatwg.org/#the-innertext-idl-attribute:text
j12t and KartikPrabhu joined the channel
# aaronpk https://pin13.net/mf2/whitespace.html is updated with the new python results!
# KartikPrabhu aaronpk: might want to keep the experimental python separate
# KartikPrabhu the new one gives you version number in the debug so should be 1.1.1
# KartikPrabhu ok
# KartikPrabhu wow! how is Ruby getting the pre correct!?
j12t joined the channel
# KartikPrabhu the expected 11 looks wrong since every whitespace in <pre> should be preserved
# KartikPrabhu yes but in 11 the e-content and p-name are not on the <pre>
# KartikPrabhu so Ruby seems to be doing correct on 11 too
# KartikPrabhu including final trim
[kevinmarks] joined the channel
# KartikPrabhu aaronpk: I actually was thinking of the \n before the one
# KartikPrabhu "one"
# KartikPrabhu because it really is "<pre>\n one [...]"
# KartikPrabhu aah I see yes. Ruby is putting two \ns
# KartikPrabhu hmmm mf2py removes that \n from HTML too
# KartikPrabhu yeah. I am using a secret hidden method for that from BeautifulSoup so might not be reliable
j12t, [chrisaldrich], tantek, [cleverdevil] and [miklb] joined the channel
# KartikPrabhu <sigh> BeautifulSoup converts <pre>\n\ntext\n</pre> to <pre>\ntext\n</pre>
# KartikPrabhu in fact always removes leading \n
# KartikPrabhu *one* leading \n
# KartikPrabhu looks like mf2py is never going to pass the <pre> whitespace tests
# KartikPrabhu oh! it is
# KartikPrabhu sknebel: so #11 here is incorrect https://pin13.net/mf2/whitespace.html ?
# KartikPrabhu for the content.html property inside the<pre>
KevinMarks and [snarfed] joined the channel
# KartikPrabhu sknebel: if you can confirm then python will win over php again ;)
kaushalmodi joined the channel
# sknebel KartikPrabhu: "In the HTML syntax, a leading newline character immediately following the pre element start tag is stripped." (https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element)
# KartikPrabhu sknebel: nice!
# KartikPrabhu aaronpk: whitespace test 11 the expected content.html is incorrect due to https://chat.indieweb.org/microformats/2018-04-02#t1522692871794700
# Loqi [sknebel] KartikPrabhu: "In the HTML syntax, a leading newline character immediately following the pre element start tag is stripped." (https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element)
# KartikPrabhu sknebel++ for finding citation
# KartikPrabhu <phew> that is another thing I don't have to fix
[kaushal_modi] joined the channel
# gRegorLove Glad you guys are tackling the whitespace stuff and not me :)
# KartikPrabhu .... and so say all of us
KevinMarks joined the channel
# KartikPrabhu <template> is always dropped no?
# KartikPrabhu which is why mf2py and phpmf2 drop <template> all to gether
# KartikPrabhu right
# KartikPrabhu yup. leave that for now
chrisaldrich, symon1, tantek, [chrisaldrich] and [kevinmarks] joined the channel
# [kevinmarks] Examples from the wild should always lead this work, and. Asking test examples should follow.
# [kevinmarks] Making, not asking.
# KartikPrabhu [kevinmarks]: for whitespace there are parser compatibility issues https://pin13.net/mf2/whitespace.html Don't really care of <template> as much
# [kevinmarks] Yes, I think what we have done with those is solid, I'm wary of template if we have never seen it in posts, whereas code in posts is something we do.
# KartikPrabhu yes I agree
# Zegnat We have seen it, and the result to seeing template elements has been that parsers throw the element out of the parsed DOM wholesale, breaking spec as written. If the parser changes (that were done to reflect in-the-wild examples) had triggered a spec update, that would have been fine. As it stands it specifically diverged parsers from the spec.
# [kevinmarks] The "using css to make whitespace significant" aspect is even harder, but again I am not sure if we have examples from the wild
# KartikPrabhu [kevinmarks]: I use CSS to make whitespaces in my notes
# KartikPrabhu see e-content in https://kartikprabhu.com/notes/better-social-networks
# KartikPrabhu Loqi gets that fine though
# KartikPrabhu yeah whitespace we all agree on
webchat254_, [eddie], vivus and webchat254__ joined the channel
# KartikPrabhu Zegnat: the whatwg innerText has 2 "\n" for <p>; is that what we want?
# KartikPrabhu I am writing an implementation in python now
# KartikPrabhu but the tests have 1. I can swap it too
# KartikPrabhu not sure if <pre> should have leading \n though
# KartikPrabhu I am ignoring that :P
# KartikPrabhu btw refering now to https://wiki.zegnat.net/media/textparsing.html
# KartikPrabhu steps 2-4 of the PLain text of element are now not needed right?
# KartikPrabhu no I am implementing the innerText from whatwg
# KartikPrabhu also are you still doing step 2 for element to string > text node ?
# KartikPrabhu replace \t\n\r by spaces?
# KartikPrabhu ok
# KartikPrabhu maybe not. Let me write this up and test it :P
KevinMarks and [eddie] joined the channel
# KartikPrabhu ok failing some tests at the moment need to debug
# KartikPrabhu should be preparing slides for a presentation, but here we are...
tantek, j12t, KevinMarks, webchat254_, chrisaldrich and KevinMarks_ joined the channel; webchat254_ left the channel