aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 2ae3d819c..6fb4bbfb1 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -731,7 +731,10 @@ blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do
slideVariant <- gets stSlideVariant
let kvs = [(k,v) | (k,v) <- kvs', k /= "width"] ++
[("style", "width:" ++ w ++ ";")
- | ("width",w) <- kvs', "column" `elem` classes]
+ | ("width",w) <- kvs', "column" `elem` classes] ++
+ [("role", "doc-bibliography") | ident == "refs" && html5] ++
+ [("role", "doc-biblioentry")
+ | "ref-item" `isPrefixOf` ident && html5]
let speakerNotes = "notes" `elem` classes
-- we don't want incremental output inside speaker notes, see #1394
let opts' = if | speakerNotes -> opts{ writerIncremental = False }
@@ -1188,13 +1191,18 @@ inlineToHtml opts inline = do
_ | html5 -> link ! H5.customAttribute
"role" "doc-noteref"
_ -> link
- (Cite cits il)-> do contents <- inlineListToHtml opts il
+ (Cite cits il)-> do contents <- inlineListToHtml opts (walk addRoleToLink il)
let citationIds = unwords $ map citationId cits
let result = H.span ! A.class_ "citation" $ contents
return $ if html5
then result ! customAttribute "data-cites" (toValue citationIds)
else result
+addRoleToLink :: Inline -> Inline
+addRoleToLink (Link (id',classes,kvs) ils (src,tit)) =
+ Link (id',classes,("role","doc-biblioref"):kvs) ils (src,tit)
+addRoleToLink x = x
+
blockListToNote :: PandocMonad m
=> WriterOptions -> String -> [Block]
-> StateT WriterState m Html