From 6d6696fc45013f88c63decab3e53b8ee26dde1b4 Mon Sep 17 00:00:00 2001 From: defanor Date: Tue, 28 Nov 2017 03:15:33 +0300 Subject: 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. --- Pancake/Rendering.hs | 7 ++++--- 1 file 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 -- cgit v1.2.3