2

https://hackage.haskell.org/package/heist-1.0.1.0/docs/Heist-Interpreted.html#v:textSplice textSplice appears to escape the contents. It replaces < to &lt; for example.

How can I avoid this escaping behaviour?

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
  • 1
    From its source code, it seems that it creates an unescaped [`Text.XmlHtml.Node`](http://hackage.haskell.org/package/xmlhtml-0.2.3.5/docs/Text-XmlHtml.html#t:Node) value. The escaping is probably done elsewhere later on. – chi Jan 30 '17 at 19:08
  • Hmm, I should have tried an example of this function in isolation. Will modify the question once confirmed. – Chris Stryczynski Jan 30 '17 at 19:38

1 Answers1

1

You can avoid the escaping behavior by parsing the whatever you want to include into a list of Nodes and then returning those directly. Here's the function you want:

http://hackage.haskell.org/package/xmlhtml-0.2.3.5/docs/Text-XmlHtml.html#v:parseHTML

mightybyte
  • 7,282
  • 3
  • 23
  • 39
  • But... the source says `textSplice t = return [X.TextNode t]` so `textSplice` already does not escape. The actual issue is probably somewhere else. Probably there's some serializer somewhere that assumes the text in the nodes is to be escaped (?) – chi Jan 31 '17 at 00:39
  • Everything in a `TextNode` gets escaped automatically. If you don't want it to get escaped you need to parse it first. Then don't call `textSplice`. Return the nodes given to you by `parseHTML` directly. – mightybyte Jan 31 '17 at 23:24