Skip to content

No test with nested IDs. #120

@Zegnat

Description

@Zegnat

Just a drive-by issue while I am doing work on a microformats2 JSON schema. There was a problem with my schema that was not caught by any JSON files in the test suite:

<div id="a" class="h-a"><div id="b" class="p-z h-b"></div><div id="c" class="h-c"></div></div>
{
  "rels": {},
  "rel-urls": {},
  "items": [
    {
      "type": [
        "h-a"
      ],
      "properties": {
        "z": [
          {
            "type": [
              "h-b"
            ],
            "properties": {
              "name": [
                ""
              ]
            },
            "id": "b",
            "value": ""
          }
        ]
      },
      "id": "a",
      "children": [
        {
          "type": [
            "h-c"
          ],
          "properties": {
            "name": [
              ""
            ]
          },
          "id": "c"
        }
      ]
    }
  ]
}

(Output taken from the great and fast in-browser TypeScript parser.)

Microformats within items collections, children collections, and when detected on properties, can all have an id object member with a string value. My schema was getting this wrong and there was no occurrence of this within the test suite to catch it.

We needs tests for this now that microformats/microformats2-parsing#44 has landed in the parsing specification, and has been there since December 2018.

I will probably look into adding a more complete example later.

Metadata

Metadata

Assignees

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