@@ -713,11 +713,15 @@ inlineToHtml opts inline =
713 htmlContents <- blockListToNote opts ref contents
713 htmlContents <- blockListToNote opts ref contents
714 -- push contents onto front of notes
714 -- push contents onto front of notes
715 put $ st {stNotes = (htmlContents:notes)}
715 put $ st {stNotes = (htmlContents:notes)}
716− return $ H.sup $
716+ let link = H.a ! A.href (toValue $ "#" ++
717− H.a ! A.href (toValue $ "#" ++ writerIdentifierPrefix opts ++ "fn" ++ ref)
717+ writerIdentifierPrefix opts ++ "fn" ++ ref)
718− ! A.class_ "footnoteRef"
718+ ! A.class_ "footnoteRef"
719− ! prefixedId opts ("fnref" ++ ref)
719+ ! prefixedId opts ("fnref" ++ ref)
720− $ toHtml ref
720+ $ toHtml ref
721+ let link' = case writerEpubVersion opts of
722+ Just EPUB3 -> link ! customAttribute "epub:type" "noteref"
724+ return $ H.sup $ link'
721 (Cite _ il) -> do contents <- inlineListToHtml opts il
725 (Cite _ il) -> do contents <- inlineListToHtml opts il
722 return $ H.span ! A.class_ "citation" $ contents
726 return $ H.span ! A.class_ "citation" $ contents
@@ -738,4 +742,8 @@ blockListToNote opts ref blocks =
738 _ -> otherBlocks ++ [lastBlock,
742 _ -> otherBlocks ++ [lastBlock,
739 Plain backlink]
743 Plain backlink]
740 in do contents <- blockListToHtml opts blocks'
744 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"
749+ return $ nl opts >> noteItem'