summaryrefslogtreecommitdiff
path: root/Pancake
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-11-28 03:15:33 +0300
committerdefanor <defanor@uberspace.net>2017-11-28 03:15:33 +0300
commit6d6696fc45013f88c63decab3e53b8ee26dde1b4 (patch)
treefcd05f8584617600088dc447bce99e1bcc462754 /Pancake
parentfbc59055579605da029b7d6f7ebb25e41fbf26d3 (diff)
Change the way images are rendered and denoted
Now it is more compact, and that's another step towards image support in the Emacs interface.
Diffstat (limited to 'Pancake')
-rw-r--r--Pancake/Rendering.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Pancake/Rendering.hs b/Pancake/Rendering.hs
index 9fb810d..94f92f2 100644
--- a/Pancake/Rendering.hs
+++ b/Pancake/Rendering.hs
@@ -360,8 +360,8 @@ readInline (P.Link attr alt (url, title)) = do
Nothing -> pure [fromString title]
readInline (P.Image attr alt (url, title)) = do
storeAttr attr
- (Fg Red "img:" :) <$> case parseURIReference url of
- Nothing -> pure [fromString title]
+ case parseURIReference url of
+ Nothing -> pure [Fg Red "i", fromString title]
Just uri -> do
a <- mapM readInline alt
let t = case (title, concat a) of
@@ -371,7 +371,8 @@ readInline (P.Image attr alt (url, title)) = do
(_, alt') -> alt'
cnt <- storeLink uri
st <- get
- pure $ map (Denote (Image uri) . Fg Cyan) t ++
+ pure $ Denote (Image uri) (Fg Red "i") :
+ map (Denote (Link uri) . Fg Cyan) t ++
[Fg Blue $ fromString
(concat ["[", showRef (referenceDigits $ rsConf st) cnt, "]"])]
readInline (P.Note bs) = do