aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-13 09:02:37 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-13 09:02:37 -0800
commite4b3da6929984478cc9a1c462deb8d7a675e5928 (patch)
tree9f97a5474d0447a4a8bc0420fbbb619dfc5f2671 /src/Text/Pandoc/Writers
parent3e079a25bce7165a618f01d2e7625bab4ca33b6b (diff)
downloadpandoc-e4b3da6929984478cc9a1c462deb8d7a675e5928.tar.gz
AsciiDoc writer: support anchors in spans with id elements.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
index b767aa669..4ac6aa093 100644
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -445,4 +445,8 @@ inlineToAsciiDoc opts (Note [Plain inlines]) = do
return $ text "footnote:[" <> contents <> "]"
-- asciidoc can't handle blank lines in notes
inlineToAsciiDoc _ (Note _) = return "[multiblock footnote omitted]"
-inlineToAsciiDoc opts (Span _ ils) = inlineListToAsciiDoc opts ils
+inlineToAsciiDoc opts (Span (ident,_,_) ils) = do
+ let identifier = if (null ident) then empty else ("[[" <> text ident <> "]]")
+ contents <- inlineListToAsciiDoc opts ils
+ return $ identifier <> contents
+