From 3e079a25bce7165a618f01d2e7625bab4ca33b6b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 13 Dec 2015 08:56:22 -0800 Subject: AsciiDoc writers: Add anchors on Div elements. This partially addresses jgm/pandoc-citeproc#143. It does not use the native asciidoc syntax for citations, but it does get the links to individual citations working. --- src/Text/Pandoc/Writers/AsciiDoc.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index 1038044e7..b767aa669 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -253,7 +253,10 @@ blockToAsciiDoc opts (OrderedList (_start, sty, _delim) items) = do blockToAsciiDoc opts (DefinitionList items) = do contents <- mapM (definitionListItemToAsciiDoc opts) items return $ cat contents <> blankline -blockToAsciiDoc opts (Div _ bs) = blockListToAsciiDoc opts bs +blockToAsciiDoc opts (Div (ident,_,_) bs) = do + let identifier = if (null ident) then empty else ("[[" <> text ident <> "]]") + contents <- blockListToAsciiDoc opts bs + return $ identifier $$ contents -- | Convert bullet list item (list of blocks) to asciidoc. bulletListItemToAsciiDoc :: WriterOptions -> [Block] -> State WriterState Doc -- cgit v1.2.3