Skip to content

hgroup has an incorrect type signature #342

@Josef-Thorne-A

Description

@Josef-Thorne-A

hgroup does not appear to have a properly typed signature.

Hgroup example usage from MDN:

 <hgroup id="document-title">
    <h1>HTML: Living Standard</h1>
    <p>Last Updated 12 July 2022</p>
  </hgroup>

If you try to recreate this example in Tyxml you'll get this error:

4 | let test = Html.(hgroup [h1 [Html.txt "Living Standard"]; p [Html.txt "Last updated..."]])
                                                 ^^^^^^^^^^^^^^^^^
Error: This expression has type [> Html_types.p ] elt
       but an expression was expected of type
         [< Html_types.hgroup_content_fun > `H1 ] elt
       Type [> Html_types.p ] = [> `P ] is not compatible with type
         [< Html_types.hgroup_content_fun > `H1 ] =
           [< `H1 | `H2 | `H3 | `H4 | `H5 | `H6 > `H1 ]
       The second variant type does not allow tag(s) `P

It looks like hgroup_content_fun should be expanded to include ``P in order to comply with the standard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions