Hamlet is whitespace sensitive like haskell and python. If you put a tag after text, it is treated as text.<br><br>Write the <a... on the next line and it will work.<br><br><div class="gmail_quote">On Fri, Aug 31, 2012 at 7:14 PM, Thiago Negri <span dir="ltr"><<a href="mailto:evohunz@gmail.com" target="_blank">evohunz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm following Yesod tutorial that gives this as the first example for<br>
"type-safe URLs":<br>
<br>
| getHomeR = defaultLayout [whamlet|<a href=@{Page1R}>Go to page 1!|]<br>
<br>
Worked fine, the "a href" generated looks perfect.<br>
Then I tried this:<br>
<br>
| getHomeR = defaultLayout [whamlet|Hello!<a href=@{Page1R}>Go to page 1!|]<br>
<br>
And got a "a href" referecing a URL without quotes and with no end tag<br>
for "a", something like this:<br>
<br>
| <html><head><title></title></head><body>Hello<a href=/page1>Go to<br>
page 1!</body></html><br>
<br>
I tried in many different ways, and the only way to get it working<br>
properly was to set the "a" tag in a line by itself:<br>
<br>
| getHomeR = defaultLayout [whamlet|Hello!<br>
| <a href=@{Page1R}>Go to page 1!<br>
| |]<br>
<br>
Is this a failure of Yesod quasiquotation or am I missing something?<br>
I know Yesod clearly states that the best approach is to use external<br>
files instead of quasiquotes, but as I'm making my first steps into<br>
Yesod, I would like to use the practical embedded quasiquotes.<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br>