git.iko.soy/typeable/pandoc
on master help sign in
Don't use sup element for epub footnotes.

Instead, just use an a element with class `footnoteRef`. This allows more styling options, and provides better results in some readers (e.g. iBooks, where anything inside the a tag breaks popup footnotes). Closes #1995.

commit4560447041a44d3eea9e442f9b5aa20911b92ed8 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 11 May 2015, 21:58 (11 years ago) parenta131441
2 files changed+5−2
data/epub.css+1 src/Text/Pandoc/Writers/HTML.hs+4−2
data/epub.css+1
@@ -12,3 +12,4 @@ h2.author { }
1212h3.date { }
1313ol.toc { padding: 0; margin-left: 1em; }
1414ol.toc li { list-style-type: none; margin: 0; padding: 0; }
15+a.footnoteRef { vertical-align: super; }
src/Text/Pandoc/Writers/HTML.hs+4−2
@@ -46,7 +46,7 @@ import Numeric ( showHex )
4646import Data.Char ( ord, toLower )
4747import Data.List ( isPrefixOf, intersperse )
4848import Data.String ( fromString )
49−import Data.Maybe ( catMaybes, fromMaybe )
49+import Data.Maybe ( catMaybes, fromMaybe, isJust )
5050import Control.Monad.State
5151import Text.Blaze.Html hiding(contents)
5252#if MIN_VERSION_blaze_markup(0,6,3)
@@ -825,7 +825,9 @@ inlineToHtml opts inline =
825825 writerIdentifierPrefix opts ++ "fn" ++ ref)
826826 ! A.class_ "footnoteRef"
827827 ! prefixedId opts ("fnref" ++ ref)
828− $ H.sup
828+ $ (if isJust (writerEpubVersion opts)
829+ then id
830+ else H.sup)
829831 $ toHtml ref
830832 return $ case writerEpubVersion opts of
831833 Just EPUB3 -> link ! customAttribute "epub:type" "noteref"