diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-03-25 01:18:33 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-03-25 01:18:33 +0300 |
commit | 4a8993f9b008a0ff223b5a1e283ae9e21a66c5c0 (patch) | |
tree | fab8ceb0dc8b999a1e08a1c87c5e4a8171153dcc /src | |
parent | d58b961a6d83a9f3a815d7aa281c692281954a00 (diff) | |
download | pandoc-4a8993f9b008a0ff223b5a1e283ae9e21a66c5c0.tar.gz |
Muse writer: improve span writing
Test more cases when span has or hasn't anchor, class and contents in different combinations.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/Muse.hs | 8 |
1 files changed, 5 insertions, 3 deletions
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 "<class name=\"" <> text (head names) <> "\">" <> contents <> "</class>" + return $ anchorDoc <> (if null inlines && not (null anchor) + then mempty + else (if null names + then "<class>" + else "<class name=\"" <> text (head names) <> "\">") <> contents <> "</class>") |