From 4ed82686e4016da2de791adf17e6aa6fddebaca5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 18 Jan 2013 12:16:12 -0800 Subject: Add data-cites field to citations in HTML5. This contains a space-separated list of citation IDs. --- src/Text/Pandoc/Writers/HTML.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 3111cbecb..32d52f3e7 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -731,8 +731,12 @@ inlineToHtml opts inline = Just EPUB3 -> link ! customAttribute "epub:type" "noteref" _ -> link return $ H.sup $ link' - (Cite _ il) -> do contents <- inlineListToHtml opts il - return $ H.span ! A.class_ "citation" $ contents + (Cite cits il)-> do contents <- inlineListToHtml opts il + let citationIds = unwords $ map citationId cits + let result = H.span ! A.class_ "citation" $ contents + return $ if writerHtml5 opts + then result ! customAttribute "data-cites" (toValue citationIds) + else result blockListToNote :: WriterOptions -> String -> [Block] -> State WriterState Html blockListToNote opts ref blocks = -- cgit v1.2.3