[Haskell-cafe] Yesod a href render issue
David McBride
toad3k at gmail.com
Sat Sep 1 02:45:46 CEST 2012
Hamlet is whitespace sensitive like haskell and python. If you put a tag
after text, it is treated as text.
Write the <a... on the next line and it will work.
On Fri, Aug 31, 2012 at 7:14 PM, Thiago Negri <evohunz at gmail.com> wrote:
> 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120831/cf626efb/attachment.htm>
More information about the Haskell-Cafe
mailing list