
Hamlet is whitespace sensitive like haskell and python. If you put a tag
after text, it is treated as text.
Write the
I'm following Yesod tutorial that gives this as the first example for "type-safe URLs":
| getHomeR = defaultLayout [whamlet|<a href=@{Page1R}>Go to page 1!|]
Worked fine, the "a href" generated looks perfect. Then I tried this:
| getHomeR = defaultLayout [whamlet|Hello!<a href=@{Page1R}>Go to page 1!|]
And got a "a href" referecing a URL without quotes and with no end tag for "a", something like this:
| <html><head><title></title></head><body>Hello<a href=/page1>Go to page 1!</body></html>
I tried in many different ways, and the only way to get it working properly was to set the "a" tag in a line by itself:
| getHomeR = defaultLayout [whamlet|Hello! | <a href=@{Page1R}>Go to page 1! | |]
Is this a failure of Yesod quasiquotation or am I missing something? I know Yesod clearly states that the best approach is to use external files instead of quasiquotes, but as I'm making my first steps into Yesod, I would like to use the practical embedded quasiquotes.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe