Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hgroup has an incorrect type signature #342

Open
Josef-Thorne-A opened this issue Feb 24, 2025 · 0 comments
Open

hgroup has an incorrect type signature #342

Josef-Thorne-A opened this issue Feb 24, 2025 · 0 comments

Comments

@Josef-Thorne-A
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant