I want to put an HTML entity (in particular, ©) into my document. However if I type it and feed it as a Text straight into a blaze combinator, the ampersand is html-escaped and comes out as literally © -- or rather, the HTML outputted is ©, which is kind of ironic.
(If I use blaze-from-html on HTML that contains ©, blaze-from-html turns it into the unicode copyright symbol "©", which works, but I'd still like to know if it was possible to access the lower-level HTML with blaze and type a literal html-source &.)
If you are using the blaze Text.Blaze.Html.toHtml function, there is a corresponding preEscapedToHtml function that will not escape entities. Sample ghci session -
λ> renderHtml $ toHtml "©"
"©"
λ> renderHtml $ preEscapedToHtml "©"
"©"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With