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

Add support for native Html (with closing tags) in Hamlet #285

Open
malteneuss opened this issue Sep 30, 2024 · 0 comments
Open

Add support for native Html (with closing tags) in Hamlet #285

malteneuss opened this issue Sep 30, 2024 · 0 comments

Comments

@malteneuss
Copy link

malteneuss commented Sep 30, 2024

I would like to suggest supporting plain Html inside the hamlet quasiquoters if possible, because

  • it makes copy-pasting Html snippets so much easier, e.g. from Bootstrap oder Bulma.
  • autocomplete and autoformatting works for plain Html inside every IDE, while Hamlet syntax support in IDEs is basically non-existent.

What do you think? If that's already supported, i would be happy to document it further as i wasn't able to find it.

Currently, when mentioning closing tags inside Hamlet, i get

src/Handler/Home.hs:26:9: error: [GHC-87897]
    • Exception when trying to run compile-time code:
        "[Hamlet input]" (line 7, column 1):
A tag name may not contain a slash. Perhaps you have a closing tag in your HTML.
CallStack (from HasCallStack):
  error, called at ./Text/Hamlet.hs:427:21 in shakespeare-2.1.1-2732f79f07a4db25d9fbeae83fe9950d9ab77dceb2046469e14a16b6716e6dea:Text.Hamlet
      Code: (xhamletFile "templates/page-test.html")
    • In the untyped splice: $(xhamletFile "templates/page-test.html")
   |
26 |         $(xhamletFile "templates/page-test.html")
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