From 19fd98e452ee1f7be902735ac76500306672f2e7 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Mon, 12 Mar 2018 01:40:23 +0300 Subject: Muse writer: support spans with anchors --- src/Text/Pandoc/Writers/Muse.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index daffa2d07..8a8217d94 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -424,7 +424,11 @@ inlineToMuse (Note contents) = do modify $ \st -> st { stNotes = contents:notes } let ref = show $ length notes + 1 return $ "[" <> text ref <> "]" -inlineToMuse (Span (_,name:_,_) inlines) = do +inlineToMuse (Span (anchor,names,_) inlines) = do contents <- inlineListToMuse inlines - return $ " text name <> "\">" <> contents <> "" -inlineToMuse (Span _ lst) = inlineListToMuse lst + let anchorDoc = if null anchor + then mempty + else text ('#':anchor) <> space + return $ anchorDoc <> if null names + then contents + else " text (head names) <> "\">" <> contents <> "" -- cgit v1.2.3