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

Wrong error message for popular HTML code (div within a label) #322

Open
Mbodin opened this issue Nov 20, 2023 · 2 comments
Open

Wrong error message for popular HTML code (div within a label) #322

Mbodin opened this issue Nov 20, 2023 · 2 comments

Comments

@Mbodin
Copy link
Contributor

Mbodin commented Nov 20, 2023

There is a popular way to style checkbox based on this HTML code:

  <label class="switch" for="checkbox">
    <input type="checkbox" id="checkbox" />
    <div class="slider"></div>
  </label>

What I did not realise is that this HTML, although popular, does not respect the specification (div should be span here).

TyXML does detect that and correctly rejects the program:

let%html checkbox =
  "<label class='switch' for='checkbox'>"
    "<input type='checkbox' id='checkbox' />"
    "<div class='slider'></div>"
  "</label>"

However, the error message is just wrong: Error: Unmatched start tag 'label', pointing at the beginning of the label element. It took me quite a long time to understand what was happening: it would be nice to have it pointing to the div element instead and state that it can't be within a label element.

I'm using TyXML 4.6.0 with tyxml-ppx.

@Drup
Copy link
Member

Drup commented Nov 27, 2023

That's probably an issue in lambdasoup. @aantron ?

@aantron
Copy link
Contributor

aantron commented Nov 29, 2023

I've opened aantron/markup.ml#77 about this. Thanks!

I can't promise when this might be addressed, but it will happen eventually and be pulled into a release.

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

3 participants