@@ -713,11 +713,15 @@ inlineToHtml opts inline =
713713 htmlContents <- blockListToNote opts ref contents
714714 -- push contents onto front of notes
715715 put $ st {stNotes = (htmlContents:notes)}
716− return $ H.sup $
717− H.a ! A.href (toValue $ "#" ++ writerIdentifierPrefix opts ++ "fn" ++ ref)
718− ! A.class_ "footnoteRef"
719− ! prefixedId opts ("fnref" ++ ref)
720− $ toHtml ref
716+ let link = H.a ! A.href (toValue $ "#" ++
717+ writerIdentifierPrefix opts ++ "fn" ++ ref)
718+ ! A.class_ "footnoteRef"
719+ ! prefixedId opts ("fnref" ++ ref)
720+ $ toHtml ref
721+ let link' = case writerEpubVersion opts of
722+ Just EPUB3 -> link ! customAttribute "epub:type" "noteref"
723+ _ -> link
724+ return $ H.sup $ link'
721725 (Cite _ il) -> do contents <- inlineListToHtml opts il
722726 return $ H.span ! A.class_ "citation" $ contents
723727
@@ -738,4 +742,8 @@ blockListToNote opts ref blocks =
738742 _ -> otherBlocks ++ [lastBlock,
739743 Plain backlink]
740744 in do contents <- blockListToHtml opts blocks'
741− return $ nl opts >> (H.li ! (prefixedId opts ("fn" ++ ref)) $ contents)
745+ let noteItem = H.li ! (prefixedId opts ("fn" ++ ref)) $ contents
746+ let noteItem' = case writerEpubVersion opts of
747+ Just EPUB3 -> noteItem ! customAttribute "epub:type" "footnote"
748+ _ -> noteItem
749+ return $ nl opts >> noteItem'