From 3a949d34da649b199235b06ab33927ad02cfdc26 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Thu, 29 Jan 2026 15:33:24 -0600 Subject: Things are compiling nicely finally --- src/Prolog.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Prolog.hs') diff --git a/src/Prolog.hs b/src/Prolog.hs index f7e72eb..1910a78 100644 --- a/src/Prolog.hs +++ b/src/Prolog.hs @@ -78,11 +78,13 @@ import Data.Bitraversable import Data.Bool import Data.ByteString qualified as B import Data.ByteString.Lazy qualified as BL +import Data.Char qualified as C import Data.Either import Data.Foldable import Data.Function import Data.Functor import Data.Functor.Contravariant +import Data.List qualified as L import Data.Map.Strict (Map) import Data.Maybe import Data.Set (Set) @@ -233,10 +235,16 @@ instance StringConv Html T.Text where strConv l = strConv l . BT.renderHtml instance StringConv Html TL.Text where - strConv _ = BT.renderHtml + strConv _ = TL.strip . BT.renderHtml instance StringConv Html String where - strConv _ = BS.renderHtml + strConv _ = strip . BS.renderHtml + where + strip :: String -> String + strip = + let d = L.dropWhile C.isSpace + in L.reverse . d . L.reverse . d + instance StringConv Html B.ByteString where strConv l = strConv l . BB.renderHtml -- cgit v1.2.3