summaryrefslogtreecommitdiff
path: root/Pancake/Rendering.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-11-08 13:57:40 +0300
committerdefanor <defanor@uberspace.net>2017-11-08 13:57:40 +0300
commit112bfa20a8b8690521eeecc939647d1bdaae4753 (patch)
tree4af22e5308c72d2cbe1018a0329ad25d85c78934 /Pancake/Rendering.hs
parent0c8ab2ac62c220073a67843612df12f242621062 (diff)
Colorize code inlines and blocks
Diffstat (limited to 'Pancake/Rendering.hs')
-rw-r--r--Pancake/Rendering.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Pancake/Rendering.hs b/Pancake/Rendering.hs
index c8922cf..cada6d3 100644
--- a/Pancake/Rendering.hs
+++ b/Pancake/Rendering.hs
@@ -267,7 +267,7 @@ readInline (P.Quoted P.DoubleQuote s) = wrappedInlines "“" "”" s
readInline (P.Cite _ s) = concat <$> mapM readInline s
readInline (P.Code attr s) = do
storeAttr attr
- pure . map fromString $ intersperse "\n" $ lines s
+ pure . map (Fg Green . fromString) $ intersperse "\n" $ lines s
readInline P.Space = pure [" "]
readInline P.SoftBreak = pure [" "]
readInline P.LineBreak = pure ["\n"]
@@ -321,7 +321,7 @@ renderBlock (P.LineBlock i) =
indented =<< concat <$> mapM (mapM readInline) i
renderBlock (P.CodeBlock attr s) = do
storeAttr attr
- indented $ map (pure . fromString) $ lines s
+ indented $ map (pure . Fg Green . fromString) $ lines s
renderBlock (P.RawBlock _ s) =
indented $ map (pure . fromString) $ lines s
renderBlock (P.BlockQuote bs) = renderBlocks bs