From 3278506866f3c49631f11ff5e694f4a6dd1a0f14 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sat, 24 Jun 2017 14:59:00 -0400 Subject: [PATCH] Simplify how images and links are projected. --- src/Language/Markdown/Syntax.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Language/Markdown/Syntax.hs b/src/Language/Markdown/Syntax.hs index f6bed6da6..fd6999ec5 100644 --- a/src/Language/Markdown/Syntax.hs +++ b/src/Language/Markdown/Syntax.hs @@ -105,10 +105,10 @@ text :: Assignment text = makeTerm <$> symbol Text <*> (Markup.Text <$> source) link :: Assignment -link = makeTerm <$> symbol Link <*> (uncurry Markup.Link <$> project (\ ((CMark.LINK url title :. _) :< _) -> (toS url, nullText title))) <* source +link = makeTerm <$> symbol Link <*> project (\ ((CMark.LINK url title :. _) :< _) -> Markup.Link (toS url) (nullText title)) <* source image :: Assignment -image = makeTerm <$> symbol Image <*> (uncurry Markup.Image <$> project (\ ((CMark.IMAGE url title :. _) :< _) -> (toS url, nullText title))) <* source +image = makeTerm <$> symbol Image <*> project (\ ((CMark.IMAGE url title :. _) :< _) -> Markup.Image (toS url) (nullText title)) <* source code :: Assignment code = makeTerm <$> symbol Code <*> (Markup.Code Nothing <$> source)