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

No author URL in 4.0.9 (Breaking change) #102

Open
Gargron opened this issue Oct 11, 2018 · 2 comments
Open

No author URL in 4.0.9 (Breaking change) #102

Gargron opened this issue Oct 11, 2018 · 2 comments

Comments

@Gargron
Copy link

Gargron commented Oct 11, 2018

undefined method `url' for #<Microformats::ParserResult:0x00005556e27ddaa0>

when accessing mf2.entry.comment.author.url in 4.0.9. This is a breaking change from 4.0.7 where it worked fine.

@dissolve
Copy link
Collaborator

I was able to reproduce this issue with a random post from your account, and it looks to be caused by the microformats spec having changed the implied u-url rules. Since u-photo exists, it no longer implies a u-url.
I realize now that should have been a version bump as that is actually a breaking change.

@dissolve
Copy link
Collaborator

Example html to reproduce.

`
<div class="h-entry">
<div class="h-cite p-comment">
<a class="status__display-name p-author h-card" rel="noopener" href="https://site.example/@AwesomeUser">
<img width="48" height="48" alt="" class="u-photo account__avatar" src="https://site.example/user-photo.png" />
<strong class="display-name__html p-name emojify">AwesomeUser</strong>
</a>
</div>
</div>

`

Not sure if we should roll back the version at this point
@jgarber623 thoughts?

Going forward, I would recommend specifying the u-url as no new parser will get this url value.
If you wrap move the classes out of the A tag to a containing tag it will work.

<div class="h-entry">
<div class="h-cite p-comment">
<div class="p-author h-card">
<a class="status__display-name u-url" rel="noopener" href="https://site.example/@AwesomeUser">
<img width="48" height="48" alt="" class="u-photo account__avatar" src="https://site.example/user-photo.png" />
<strong class="display-name__html p-name emojify">AwesomeUser</strong>
</a>
</div>
</div>
</div>`

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

2 participants