mf2py
mf2py copied to clipboard
Implied photo relative path resolution failure
Looks like there's a problem where relative path resolution doesn't kick in in some cases. Example:
<img class="h-card" alt="Jane Doe" src="jane.jpeg"/>
<object class="h-card" data="jane.jpeg">Jane Doe</object>
is parsed as
"items": [
{
"properties": {
"name": [
"Jane Doe"
],
"photo": [
"http://example.com/jane.jpeg"
]
},
"type": [
"h-card"
]
},
{
"properties": {
"name": [
"Jane Doe"
],
"photo": [
"jane.jpeg"
]
},
"type": [
"h-card"
]
}
]
here is a full example
<html>
<base href="http://example.com" />
<img class="h-card" alt="Jane Doe" src="jane-img.jpeg"/>
<object class="h-card" data="jane-object.jpeg">Jane Doe</object>
</html>
is parsed as two h-cards. The first one is correct with the relative URL resolved
{
"properties": {
"name": [
"Jane Doe"
],
"photo": [
"http://example.com/jane-img.jpeg"
]
},
"type": [
"h-card"
]
}
but the second one still has a relative URL even if base is specified
{
"properties": {
"name": [
"Jane Doe"
],
"photo": [
"jane-object.jpeg"
]
},
"type": [
"h-card"
]
}