aaronpk / microformats-blankspace-tests

https://pin13.net/mf2/blankspace.html
The Unlicense
0 stars 1 forks source link

whitespace between tags #4

Open kartikprabhu opened 6 years ago

kartikprabhu commented 6 years ago

What is the expected p-name for these examples with respect to white spacing? (example 1 borrowed from https://github.com/microformats/mf2py/issues/112 ) cc: @snarfed @sknebel @gregorlove @Zegnat

<article class="h-entry">
  <div class="p-name">
    foo <span>bar</span>
  </div>
</article>
<article class="h-entry">
  <div class="p-name">
    foo <span>  bar</span>
  </div>
</article>
<article class="h-entry">
  <div class="p-name">
    foo <span>  bar </span>
  </div>
</article>

edit: 2018-07-25 more examples

<article class="h-entry">
  <div class="p-name">
    <span>foo</span> <span>  bar </span>
  </div>
</article>
<article class="h-entry">
  <div class="p-name">
   <span> foo </span><span>  bar </span>
  </div>
</article>
<article class="h-entry">
  <div class="p-name">
   <span> foo </span>    <span>  bar </span>
  </div>
</article>
<article class="h-entry">
  <div class="p-name">
   <span> foo </span>
    <span>  bar </span>
  </div>
</article>

And all of the above with each <span> replaced by <div> or <p> or <pre>.

sknebel commented 6 years ago

In my attempt at fixing https://github.com/microformats/mf2py/issues/112 I'm currently assuming "name": "foo bar", since that appears to match browser behavior.

snarfed commented 6 years ago

I'm no expert, but i think @sknebel is right, based on how i think recursive textContent interacts with "removing all leading/trailing whitespace" from eg http://microformats.org/wiki/microformats2-parsing#parsing_an_p-_property

... which would mean it's also true for all p- and e- (value) properties.