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 <img> handling in implied p-name #180

Closed
gRegorLove opened this issue Jul 7, 2018 · 0 comments
Closed

Fix <img> handling in implied p-name #180

gRegorLove opened this issue Jul 7, 2018 · 0 comments
Milestone

Comments

@gRegorLove
Copy link
Member

gRegorLove commented Jul 7, 2018

The parsing spec was updated for handling <img> in implied p-name parsing. src should no longer be part of the implied p-name.

  • else use the textContent of the .h-x for name after:
    • dropping any nested <script> & <style> elements;
    • replacing any nested <img> elements with their alt attribute, if present;

HTML:

<p class="h-card">My Name <img src="http://xyz" /></p>

Parsed:

"type": [
    "h-card"
],
"properties": {
    "name": [
        "My Name http:\/\/xyz"
    ],
    "photo": [
        "http:\/\/xyz"
    ]
}

Expected:

"type": [
    "h-card"
], 
"properties": {
    "photo": [
        "http://xyz"
    ], 
    "name": [
        "My Name"
    ]
}

Note that 0.4.3 does not have this issue but 0.4.4-alpha does. The new text parsing algorithm includes the src because it was written against the spec before this update.

mf2py has a PR supporting this: microformats/mf2py#106

@gRegorLove gRegorLove added this to the 0.4.4 milestone Aug 1, 2018
@aaronpk aaronpk modified the milestones: 0.4.4, 0.4.5 Aug 1, 2018
gRegorLove added a commit to gRegorLove/php-mf2 that referenced this issue Aug 23, 2018
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