kartikprabhu / mf2py

mf2 parser in python (this is an experimental fork)
Other
3 stars 2 forks source link

Implement classic hAtom rel-bookmark backcompat #45

Closed kartikprabhu closed 9 years ago

kartikprabhu commented 10 years ago

http://microformats.org/wiki/h-entry#What_about_rel_bookmark basically use rel-bookmark as a u-url for h-entry

Example if usage: http://morning.computer/

similar issue in php-mf2 https://github.com/indieweb/php-mf2/issues/57

snarfed commented 9 years ago

/sub

kartikprabhu commented 9 years ago

@kylewm the latest PR you sent with the rel-bookmark -> u-url seems to work on the following:

<div class="hentry">
<a rel="bookmark" href="#ha">
        <h1 class="entry-title">title</h1>
</a>
not the title
</div>

It picks up both the rel-bookmark -> u-url and the title but not on the following:

<div class="hentry">
<h1 class="entry-title">
        <a rel="bookmark" href="#ha">title</a>
</h1>
not the title
</div>

here it only picks up the title and the bookmark goes into the rels list but not the u-url property.

I suspect something wrong in this recursion line: https://github.com/kartikprabhu/mf2py/blob/master/mf2py/backcompat.py#L168 but I can't see it just yet.

kartikprabhu commented 9 years ago

update: the above problem is on my production server but not on my local machine!

kylewm commented 9 years ago

i just tried it with a bunch of combinations of python 2 and 3, and backend parsing libraries, and it seems to work for all of them... are you 100% sure your production server is running the latest version of mf2py?

kylewm commented 9 years ago

the first case <div class="hentry"><a href="#ha"></a></div> would work without rel-bookmark, because of the implied parsing rules.

kartikprabhu commented 9 years ago

@kylewm ah of course... implied rules. Then it seems my production server is still using the old version for some reason. thanks.

kartikprabhu commented 9 years ago

@kylewm you were right. My production was using old src files from somewhere. Fixed now and it all works!