diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-03-14 07:10:03 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-03-14 07:10:03 +0100 |
commit | 11284c7c12c44e12de1cfc712c0391d5ee32a9f2 (patch) | |
tree | 553a527ff19f5ef105cbc2f026284e75fa5900db /app/Render.hs | |
parent | c8ab97e77c8ab56b9835d9f260dc222a10e9b3c6 (diff) | |
parent | 09e26c37de7e7227d856ffe15c9554af36b50c58 (diff) |
Merge remote-tracking branch 'origin/feature/review'main
Diffstat (limited to 'app/Render.hs')
-rw-r--r-- | app/Render.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/Render.hs b/app/Render.hs index 907ef15..56d78aa 100644 --- a/app/Render.hs +++ b/app/Render.hs @@ -24,8 +24,9 @@ module Render renderAsMarkdown, -- * Additional symbols - plus, + hash, minus, + plus, ) where @@ -81,15 +82,15 @@ instance Render a => Render (IO a) where (Just a, Nothing) -> a (Nothing, Just b) -> b (Just a, Just b) -> - if endsWithNL a || startsWithNL b + if endsWithWS a || startsWithWS b then a <> b else a <> space <> b where nonEmpty x' = let x = render x' in if not (null (show x)) then Just (render x) else Nothing - startsWithNL = ("\n" `isPrefixOf`) . show . render - endsWithNL = ("\n" `isSuffixOf`) . show . render + startsWithWS = ((||) <$> ("\n" `isPrefixOf`) <*> (" " `isPrefixOf`)) . show . render + endsWithWS = ((||) <$> ("\n" `isSuffixOf`) <*> (" " `isSuffixOf`)) . show . render (===) :: (Render a, Render b) => a -> b -> Doc AnsiStyle (===) a' b' = @@ -244,8 +245,7 @@ instance Render D.Node where pretty ("\")" :: T.Text) ] -plus :: Doc ann -plus = pretty ("+" :: T.Text) - -minus :: Doc ann +hash, minus, plus :: Doc ann +hash = pretty ("#" :: T.Text) minus = pretty ("-" :: T.Text) +plus = pretty ("+" :: T.Text) |