Is there some way in yesod-0.9.3 to convert Json to Html to include it into <script/> tag?
Using Yesod.Json and Data.Aeson I can get the value of a Json type, which I want to use as the value of a variable introduced in a <script> tag, that is, not to return RepJson, but to include it as a part of RepHtml.
Using fully qualified names…
then, inside your hamlet:
Note that this is a bit dangerous in that it doesn’t check that the encoding was successful. Look at the
Data.Text.Encodingmodule for more info.