about summary refs log tree commit diff
path: root/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2024-05-09T11·10+0200
committerclbot <clbot@tvl.fyi>2024-05-13T14·38+0000
commit15054715d68737957763d04c8fea08c57305b71c (patch)
tree3cc010701bd211952eafeb0d349512d22dd87a31 /users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
parent58156967b85d8b6c4920f98e43c12d5f55490619 (diff)
fix(users/Profpatsch/whatcd-resolver): always use good html renderer r/8120
The pretty renderer would add extra newlines, making the html
different.

Change-Id: I28496cbec61d4c9c63f657a499a1990f891949ee
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11639
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
Autosubmit: Profpatsch <mail@profpatsch.de>
Diffstat (limited to '')
-rw-r--r--users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs7
1 files changed, 1 insertions, 6 deletions
diff --git a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
index ee1879b412..054728cb9d 100644
--- a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
+++ b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
@@ -55,7 +55,6 @@ import System.Directory qualified as Xdg
 import System.Environment qualified as Env
 import System.FilePath ((</>))
 import Text.Blaze.Html (Html)
-import Text.Blaze.Html.Renderer.Pretty qualified as Html.Pretty
 import Text.Blaze.Html.Renderer.Utf8 qualified as Html
 import Text.Blaze.Html5 qualified as Html
 import Tool (readTool, readTools)
@@ -313,10 +312,6 @@ runHandlers ::
   (Wai.Response -> IO ResponseReceived) ->
   m ResponseReceived
 runHandlers debug defaultHandler handlers req respond = withRunInIO $ \runInIO -> do
-  let renderHtml =
-        if debug
-          then Html.Pretty.renderHtml >>> stringToText >>> textToBytesUtf8 >>> toLazyBytes
-          else Html.renderHtml
   let hh route act =
         Otel.inSpan'
           [fmt|Route {route}|]
@@ -329,7 +324,7 @@ runHandlers debug defaultHandler handlers req respond = withRunInIO $ \runInIO -
           )
           ( \span -> do
               res <- act span
-              liftIO $ respond . Wai.responseLBS Http.ok200 ([("Content-Type", "text/html")] <> res.extraHeaders) . renderHtml $ res.html
+              liftIO $ respond . Wai.responseLBS Http.ok200 ([("Content-Type", "text/html")] <> res.extraHeaders) . Html.renderHtml $ res.html
           )
   let h route act = hh route (\span -> act span <&> (\html -> T2 (label @"html" html) (label @"extraHeaders" [])))