Don't parse root/property class names with consecutive dashes
gRegorLove opened this issue · 0 comments
gRegorLove commented
<div class="h-entry h-----">
<p> <a href="http://example.com/post" class="u-in-reply--to">http://example.com/post posted:</a> </p>
<span class="p-name">Too many dashes</span>
<span class="p--acme-leading">leading dash</span>
<span class="p-acme--middle">middle dash</span>
<span class="p-acme-trailing-">trailing dash</span>
</div>
Currently parses:
{
"items": [
{
"type": [
"h-----",
"h-entry"
],
"properties": {
"name": [
"Too many dashes"
],
"-acme-leading": [
"leading dash"
],
"acme--middle": [
"middle dash"
],
"acme-trailing-": [
"trailing dash"
],
"in-reply--to": [
"http://example.com/post"
]
}
}
],
"rels": {},
"rel-urls": {},
"debug": {
"package": "https://packagist.org/packages/mf2/mf2",
"version": "v0.4.1",
"note": [
"This output was generated from the php-mf2 library available at https://github.com/indieweb/php-mf2",
"Please file any issues with the parser at https://github.com/indieweb/php-mf2/issues"
]
}
}
Expected output via mf2py dev
{
"rels": {},
"items": [
{
"type": [
"h-entry"
],
"properties": {
"name": [
"Too many dashes"
]
}
}
],
"rel-urls": {},
"debug": {
"source": "https://github.com/microformats/mf2py",
"version": "1.1.0",
"markup parser": "html5lib",
"description": "mf2py - microformats2 parser for python"
}
}
Per spec update: microformats/microformats2-parsing#31