Skip to content

Commit

Permalink
Fix CSS rendering for golden tests
Browse files Browse the repository at this point in the history
There were two extra spaces before each CSS Node and an extra newline
before and after the CSS attributes. I assume the tests were the desired
outcome.
  • Loading branch information
Skyfold committed Dec 12, 2024
1 parent d9a7072 commit 4eb4290
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Web/View/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ renderText' c vw =
addCss :: [Text] -> Text -> Text
addCss [] cnt = cnt
addCss css cnt = do
renderLines (renderContent 2 $ styleElement css) <> "\n\n" <> cnt
renderLines (renderContent 0 $ styleElement css) <> "\n\n" <> cnt

styleElement :: [Text] -> Content
styleElement css =
Node $ element "style" (Attributes [] [("type", "text/css")]) $ do
pure $ Raw $ "\n" <> intercalate "\n" css <> "\n"
pure $ Raw $ intercalate "\n" css


renderContent :: Int -> Content -> [Line]
Expand Down

0 comments on commit 4eb4290

Please sign in to comment.