summaryrefslogtreecommitdiff
path: root/Pancake.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-10-26 20:07:10 +0300
committerdefanor <defanor@uberspace.net>2017-10-26 20:07:10 +0300
commita3df7b27878edbf2d28f9c8d1aeb92788fa3bfd7 (patch)
tree78eb691b90de9cd71d8e50afca862a53c273c37e /Pancake.hs
parent178e8328df38d67cef388eabe4de19469aadc1e8 (diff)
Don't store or count fragment links
It doesn't make much difference, but would provide nicer enumeration.
Diffstat (limited to 'Pancake.hs')
-rw-r--r--Pancake.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Pancake.hs b/Pancake.hs
index 2663f03..2508483 100644
--- a/Pancake.hs
+++ b/Pancake.hs
@@ -272,7 +272,6 @@ readInline (P.RawInline _ s) = pure . pure $ fromString s
readInline (P.Link _ alt (url, title)) =
case parseURIReference url of
Just uri -> do
- cnt <- storeLink uri
a <- mapM readInline alt
let t = case (title, a) of
("", []) -> [fromString url]
@@ -283,7 +282,8 @@ readInline (P.Link _ alt (url, title)) =
-- fragment links are mostly useless here, at least for now.
-- but still marking them as links, to avoid confusion.
(URI "" Nothing "" "" _) -> pure $ map (Fg DullCyan) t
- _ -> pure $ map (Fg Cyan) t ++ [Fg Blue (mconcat ["[", fromString $ show cnt, "]"])]
+ _ -> storeLink uri >>=
+ \cnt -> pure $ map (Fg Cyan) t ++ [Fg Blue (mconcat ["[", fromString $ show cnt, "]"])]
Nothing -> pure . pure $ fromString title
readInline (P.Image attr alt (url, title)) = do
asLink <- readInline (P.Link attr alt (url, title))