Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should HCards be found within h-entry's? #34

Closed
philgyford opened this issue Apr 9, 2022 · 0 comments
Closed

Should HCards be found within h-entry's? #34

philgyford opened this issue Apr 9, 2022 · 0 comments

Comments

@philgyford
Copy link

The HCard parser currently uses mf2py to get a list of "items" and only looks for an h-card item at the top level of that, i.e. alongside the h-entry item.

I think it's also OK to have a p-author h-card within an h-entry to indicate its author. For example, from the Microformats h-entry wiki page:

<article class="h-entry">
  <h1 class="p-name">Microformats are amazing</h1>
  <p>Published by <a class="p-author h-card" href="http://example.com">W. Developer</a>
     on <time class="dt-published" datetime="2013-06-13 12:00:00">13<sup>th</sup> June 2013</time></p>
  
  <p class="p-summary">In which I extoll the virtues of using microformats.</p>
  
  <div class="e-content">
    <p>Blah blah blah</p>
  </div>
</article>

I guess this would require adding to the _parse_hcard() method, so that if the item is an h-card, to look for an author item within it (or more than one?) and see if it has an 'h-card'?

I guess any author h-card should take precedence over an h-card at the same level as the h-entry...?

It all gets a bit complicated!

beatonma added a commit that referenced this issue Sep 29, 2022
`h-card` can now be found correctly when embedded in `p-author` inside
`h-feed` and `h-entry` containers.

Refactoring: new package `mentions.tasks.incoming.parsing`:
- Moved `h-card` parsing logic from `@classmethod
  HCard.from_soup(BeautifulSoup)` to `parse_hcard(BeautifulSoup)`
  function.
- Also moved webmention 'type' parsing logic to this package.
@beatonma beatonma mentioned this issue Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant