[Haskell-cafe] Yesod a href render issue

Thiago Negri evohunz at gmail.com
Sat Sep 1 01:14:26 CEST 2012


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.



More information about the Haskell-Cafe mailing list