aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-03-12 01:40:23 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-03-12 01:47:20 +0300
commit19fd98e452ee1f7be902735ac76500306672f2e7 (patch)
tree1a61917f7e16c6d66ff573d644b8797884f36a2a /src/Text/Pandoc
parent9bcd0908482f26e3630a02e3ad3596a2f67fcab9 (diff)
downloadpandoc-19fd98e452ee1f7be902735ac76500306672f2e7.tar.gz
Muse writer: support spans with anchors
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs10
1 files changed, 7 insertions, 3 deletions
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 $ "<class name=\"" <> text name <> "\">" <> contents <> "</class>"
-inlineToMuse (Span _ lst) = inlineListToMuse lst
+ 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>"