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

Fix u- parsing for <video> with poster attribute #114

Closed
gRegorLove opened this issue Apr 30, 2017 · 1 comment · Fixed by #120
Closed

Fix u- parsing for <video> with poster attribute #114

gRegorLove opened this issue Apr 30, 2017 · 1 comment · Fixed by #120

Comments

@gRegorLove
Copy link
Member

gRegorLove commented Apr 30, 2017

video element's poster attribute should be used when parsing for u-, per http://microformats.org/wiki/microformats2-parsing##else+if+video

Isolated example from microformats test suite:

<div class="h-entry">
    <p class="p-name">microformats.org at 7</p>
    <video class="u-photo" poster="posterimage.jpg">
        Sorry, your browser doesn't support embedded videos.
    </video>
</div>

Expected result:

{
    "items": [{
        "type": ["h-entry"],
        "properties": {
            "name": ["microformats.org at 7"],
            "photo": ["posterimage.jpg"]
        }
    }],
    "rels": {},
    "rel-urls": {}
}

Test: https://github.com/microformats/tests/blob/master/tests/microformats-v2/h-entry/u-property.html
Expected: https://github.com/microformats/tests/blob/master/tests/microformats-v2/h-entry/u-property.json

@aaronpk
Copy link
Member

aaronpk commented May 24, 2017

The example test is a little unrealistic, since there is no actual video file referenced. Is there a better example we could use for the test that references both a poster image as well as a video file? I believe it would be something like this.

<div class="h-entry">
    <p class="p-name">microformats.org at 7</p>
    <video class="u-photo" poster="posterimage.jpg">
        <source class="u-video" src="video.mp4" type="video/mp4">
        Sorry, your browser doesn't support embedded videos.
    </video>
</div>
{
    "items": [{
        "type": ["h-entry"],
        "properties": {
            "name": ["microformats.org at 7"],
            "photo": ["posterimage.jpg"],
            "video": ["video.mp4"]
        }
    }],
    "rels": {},
    "rel-urls": {}
}

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

Successfully merging a pull request may close this issue.

2 participants