Skip to content

Properties not parsed when using Tailwind height class #246

@HyperTesto

Description

@HyperTesto

I managed to get a minimal example that happened to me while working with Tailwind CSS, but i guess it's more generic to any class that starts with h- prefix.

If i use Tailwind CSS h-<number> class on some elements that have other microformat classes like in this minimal example with u-logo and u-nickname:

<article class="h-card">
   <h1> TITLE </h1>
   <img class="h-36 photo u-logo" 
          alt="An example alt title"
          src="https://example.com/img.png"
    />
    <p class="h-21 u-nickname"> John Doe </p>
</article>

The parser skips mf properties and produces :

{
    "items": [
        {
            "type": [
                "h-card"
            ],
            "properties": {
                "name": [
                    "TITLE An example alt title\nJohn Doe"
                ]
            }
        }
    ],
    "rels": {},
    "rel-urls": {},
    "debug": {
        "package": "https://packagist.org/packages/mf2/mf2",
        "source": "https://github.com/indieweb/php-mf2",
        "version": "v0.5.0",
        "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",
            "Using the Masterminds HTML5 parser"
        ]
    }
}

Instead, if I remove h- classes, it's working as expected:

<article class="h-card">
   <h1> TITLE </h1>
   <img class="photo u-logo" 
          alt="An example alt title"
          src="https://example.com/img.png"
    />
    <p class="u-nickname"> John Doe </p>
</article>

with output:

{
    "items": [
        {
            "type": [
                "h-card"
            ],
            "properties": {
                "logo": [
                    {
                        "value": "https://example.com/img.png",
                        "alt": "An example alt title"
                    }
                ],
                "nickname": [
                    "John Doe"
                ],
                "name": [
                    "TITLE An example alt title\nJohn Doe"
                ]
            }
        }
    ],
    "rels": {},
    "rel-urls": {},
    "debug": {
        "package": "https://packagist.org/packages/mf2/mf2",
        "source": "https://github.com/indieweb/php-mf2",
        "version": "v0.5.0",
        "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",
            "Using the Masterminds HTML5 parser"
        ]
    }
}

This scenario seems to work using the Go implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions