microformats / php-mf2

php-mf2 is a pure, generic microformats-2 parser for PHP. It makes HTML as easy to consume as JSON.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dt-parsing seems to try to interpret value (breaking it in some cases)

sknebel opened this issue · comments

commented

Regression from last release to master
Example site: https://aaronparecki.com/, which has

<div class="h-card">
<time class="dt-bday" datetime="--12-28"></time> 
</div>

output:

{
   "type": ["h-entry"],
   "properties": {
                "bday": ["--12-2800"],
            }
 }

expected output: "bday": ["--12-28"]

This looks like php-mf2 tries to parse the date, instead of simply passing through the value it finds in the datetime=property.

Thanks for catching that! It's incorrectly interpreting "-28" as a TZ offset and normalizing it. I'll work on a fix.

commented

It should not interpret anything from a non-VCP datetime. There's been suggestions to always do some dt parsing instead of only for VCP and to produce a more normalized format, but (from what I know) no clear proposed spec changes, so right now arguably anything that produces not exactly the input string is kind of a bug. Is there some documentation what php-mf2 tries to do here?