git.iko.soy/typeable/pandoc
on master help sign in
HTML/EPUB footnotes: Put `<sup>` tag inside `<a>` tags.

This allows better control of formatting, since the `<a>` tags have a distinguishing class. Closes #1049.

commitb4441c940dc76d1a64636ef88287b38306ebccb4 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 12 Nov 2013, 18:48 (13 years ago) parentfa15302
2 files changed+7−7
src/Text/Pandoc/Writers/HTML.hs+4−4 tests/writer.html+3−3
src/Text/Pandoc/Writers/HTML.hs+4−4
@@ -757,11 +757,11 @@ inlineToHtml opts inline =
757757 writerIdentifierPrefix opts ++ "fn" ++ ref)
758758 ! A.class_ "footnoteRef"
759759 ! prefixedId opts ("fnref" ++ ref)
760+ $ H.sup
760761 $ toHtml ref
761− let link' = case writerEpubVersion opts of
762− Just EPUB3 -> link ! customAttribute "epub:type" "noteref"
763− _ -> link
764− return $ H.sup $ link'
762+ return $ case writerEpubVersion opts of
763+ Just EPUB3 -> link ! customAttribute "epub:type" "noteref"
764+ _ -> link
765765 (Cite cits il)-> do contents <- inlineListToHtml opts il
766766 let citationIds = unwords $ map citationId cits
767767 let result = H.span ! A.class_ "citation" $ contents
tests/writer.html+3−3
@@ -544,12 +544,12 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
544544<p>Here is a movie <img src="movie.jpg" alt="movie" /> icon.</p>
545545<hr />
546546<h1 id="footnotes">Footnotes</h1>
547−<p>Here is a footnote reference,<sup><a href="#fn1" class="footnoteRef" id="fnref1">1</a></sup> and another.<sup><a href="#fn2" class="footnoteRef" id="fnref2">2</a></sup> This should <em>not</em> be a footnote reference, because it contains a space.[^my note] Here is an inline note.<sup><a href="#fn3" class="footnoteRef" id="fnref3">3</a></sup></p>
547+<p>Here is a footnote reference,<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> and another.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a> This should <em>not</em> be a footnote reference, because it contains a space.[^my note] Here is an inline note.<a href="#fn3" class="footnoteRef" id="fnref3"><sup>3</sup></a></p>
548548<blockquote>
549−<p>Notes can go in quotes.<sup><a href="#fn4" class="footnoteRef" id="fnref4">4</a></sup></p>
549+<p>Notes can go in quotes.<a href="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a></p>
550550</blockquote>
551551<ol style="list-style-type: decimal">
552−<li>And in list items.<sup><a href="#fn5" class="footnoteRef" id="fnref5">5</a></sup></li>
552+<li>And in list items.<a href="#fn5" class="footnoteRef" id="fnref5"><sup>5</sup></a></li>
553553</ol>
554554<p>This paragraph should not be part of the note, as it is not indented.</p>
555555<div class="footnotes">