From 4a8993f9b008a0ff223b5a1e283ae9e21a66c5c0 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sun, 25 Mar 2018 01:18:33 +0300 Subject: Muse writer: improve span writing Test more cases when span has or hasn't anchor, class and contents in different combinations. --- src/Text/Pandoc/Writers/Muse.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 6ecd826fa..128e2c6f9 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -441,6 +441,8 @@ inlineToMuse (Span (anchor,names,_) inlines) = do let anchorDoc = if null anchor then mempty else text ('#':anchor) <> space - return $ anchorDoc <> if null names - then contents - else " text (head names) <> "\">" <> contents <> "" + return $ anchorDoc <> (if null inlines && not (null anchor) + then mempty + else (if null names + then "" + else " text (head names) <> "\">") <> contents <> "") -- cgit v1.2.3