Add data-cites field to citations in HTML5.

This contains a space-separated list of citation IDs.
This commit is contained in:
John MacFarlane 2013-01-18 12:16:12 -08:00
parent 809d74b86d
commit 4ed82686e4

View file

@ -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 =