snoyberg/xml

html-conduit removes '<' symbols from strings in '<script>' tags

emhoracek opened this issue · 2 comments

Ran into problems with the custom javascript components in my app after upgrading our template library to the latest version.

I tried this test:

  it "should not remove '<' symbols in script strings" $
    let (X.Document _ (X.Element _ _ nodes) _) =
      H.parseLT ("<script>console.log(\"<custom-component />\")</script>") in
    nodes `shouldBe` [X.NodeContent "console.log(\"<custom-component />\")"]

It fails with:

1) HTML parsing should not remove '<' symbols in script strings
    expected: [NodeContent "console.log(\"<custom-component />\")"]
    but got: [NodeContent "console.log(\"custom-component />\")"]

You say that upgrading to the latest version has this problem. Do earlier version not have this problem?

@snoyberg Earlier versions did not have this problem -- upgrading our Stackage resolver from lts-8.15 to lts-12.11 is what caused it.