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

include img alt text in photo property #83

Closed
snarfed opened this issue Jul 10, 2017 · 8 comments
Closed

include img alt text in photo property #83

snarfed opened this issue Jul 10, 2017 · 8 comments

Comments

@snarfed
Copy link
Member

snarfed commented Jul 10, 2017

one drawback of the current mf2 spec is that img alt text is lost when a higher priority name property is provided, e.g. p-name. microformats/microformats2-parsing#2 proposes preserving alt text in e.g. the photo property by making it a composite object with a new alt field when alt text is available.

this is currently blocking a bridgy feature request, snarfed/bridgy#756, so i'd love to see it added to mf2py!

example: this HTML:

<article class="h-entry">
  <span class="p-name">name</span>
  <img class="u-photo" src="/photo.jpg" alt="alt" />
</article>

would parse to this mf2:

{
  "type": ["h-entry"],
  "properties": {
    "name": ["name"],
    "photo": [{
        "value": "/photo.jpg",
        "alt": "alt"
    }]
}
@snarfed
Copy link
Member Author

snarfed commented Sep 7, 2017

friendly ping! cc @kylewm since he's worked on mf2py before too.

@snarfed
Copy link
Member Author

snarfed commented Apr 9, 2018

now tracked (also? instead?) in kartikprabhu#56.

@snarfed
Copy link
Member Author

snarfed commented May 9, 2018

hey @kartikprabhu any chance of getting this into the upcoming release?

@kartikprabhu
Copy link
Member

unlikely. Haven't even started to code this up yet; also hugely breaking change and not in spec yet.

@snarfed
Copy link
Member Author

snarfed commented May 9, 2018

as @tantek @aaronpk et al would say, specs are best when they describe and formalize already existing behavior, not prescribe new behavior before it's been implemented anywhere. :P

no worries though, happy to wait!

@sknebel
Copy link
Member

sknebel commented May 9, 2018

Would it make sense to have feature flags for things like this, so consumers could opt-in to them at first, and them being switched on by default later?

@aaronpk
Copy link
Member

aaronpk commented May 9, 2018

We've done some feature flag stuff in the PHP parser to selectively enable new/experimental features.

@kartikprabhu
Copy link
Member

kartikprabhu commented May 24, 2018

Should implied photo also have the alt value?

cc: @snarfed

Example:

<article class="h-entry">
  <span class="p-name">name</span>
  <img src="/photo.jpg" alt="alt" />
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants