Skip to content

Does not Correctly Parse Input Tags #456

@carrvo

Description

@carrvo

Describe the bug

Properties stored in an input tag are not being populated by its value attribute. Looks like the spec supports this

else if data.p-x[value] or input.p-x[value], then return the value attribute

To Reproduce

HTML input:

<html lang="en">
<body>
		<div class="h-item">
				<input class="p-name" type="text" value="A">
				<input class="p-value" type="number" value="10">
		</div>

</body></html>

Expected behavior

Correct JSON output:

{
  "rels": {},
  "rel-urls": {},
  "items": [
    {
      "type": [
        "h-item"
      ],
      "properties": {
        "name": [
          "A"
        ],
        "value": [
          "10"
        ]
      },
      "lang": "en"
    }
  ]
}

Observed behavior

JSON output observed on demo

{
  "rels": {},
  "rel-urls": {},
  "items": [
    {
      "type": [
        "h-item"
      ],
      "properties": {
        "name": [
          ""
        ],
        "value": [
          ""
        ]
      },
      "lang": "en"
    }
  ]
}

Additional context

I am using this in a browser whereby a user can update the input then click a button that will parse it from the live page.

let data = mf2(document.documentElement.outerHTML, { baseUrl: document.baseURI });

I then process the output (such as with ChartJS).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions