aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-05-11 21:58:01 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-05-11 21:58:01 -0700
commit4560447041a44d3eea9e442f9b5aa20911b92ed8 (patch)
tree880b7b9b8d12c96ec67b898ef27ee88c429d66f9 /src/Text
parenta131441da471fa80523c957cd8193af37de6769c (diff)
downloadpandoc-4560447041a44d3eea9e442f9b5aa20911b92ed8.tar.gz
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.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 3a89b226b..022a0e17f 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -46,7 +46,7 @@ import Numeric ( showHex )
import Data.Char ( ord, toLower )
import Data.List ( isPrefixOf, intersperse )
import Data.String ( fromString )
-import Data.Maybe ( catMaybes, fromMaybe )
+import Data.Maybe ( catMaybes, fromMaybe, isJust )
import Control.Monad.State
import Text.Blaze.Html hiding(contents)
#if MIN_VERSION_blaze_markup(0,6,3)
@@ -825,7 +825,9 @@ inlineToHtml opts inline =
writerIdentifierPrefix opts ++ "fn" ++ ref)
! A.class_ "footnoteRef"
! prefixedId opts ("fnref" ++ ref)
- $ H.sup
+ $ (if isJust (writerEpubVersion opts)
+ then id
+ else H.sup)
$ toHtml ref
return $ case writerEpubVersion opts of
Just EPUB3 -> link ! customAttribute "epub:type" "noteref"