yesodweb / shakespeare

Haml-like template files that are compile-time checked
http://www.yesodweb.com/book/shakespearean-templates
MIT License
136 stars 76 forks source link

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

Open malteneuss opened 1 month ago

malteneuss commented 1 month ago

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

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")