git.iko.soy/typeable/pandoc
on master help sign in
HTML/EPUB footnotes: Put `<sup>` tag inside `<a>` tags.
b4441c9John MacFarlane
src/Text/Pandoc/Writers/HTML.hs+4−4
@@ -757,11 +757,11 @@ inlineToHtml opts inline =
757 writerIdentifierPrefix opts ++ "fn" ++ ref)
757 writerIdentifierPrefix opts ++ "fn" ++ ref)
758 ! A.class_ "footnoteRef"
758 ! A.class_ "footnoteRef"
759 ! prefixedId opts ("fnref" ++ ref)
759 ! prefixedId opts ("fnref" ++ ref)
760+ $ H.sup
760 $ toHtml ref
761 $ toHtml ref
761− let link' = case writerEpubVersion opts of
762+ return $ case writerEpubVersion opts of
762− Just EPUB3 -> link ! customAttribute "epub:type" "noteref"
763+ Just EPUB3 -> link ! customAttribute "epub:type" "noteref"
763− _ -> link
764+ _ -> link
764− return $ H.sup $ link'
765 (Cite cits il)-> do contents <- inlineListToHtml opts il
765 (Cite cits il)-> do contents <- inlineListToHtml opts il
766 let citationIds = unwords $ map citationId cits
766 let citationIds = unwords $ map citationId cits
767 let result = H.span ! A.class_ "citation" $ contents
767 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'+'>');
544<p>Here is a movie <img src="movie.jpg" alt="movie" /> icon.</p>
544<p>Here is a movie <img src="movie.jpg" alt="movie" /> icon.</p>
545<hr />
545<hr />
546<h1 id="footnotes">Footnotes</h1>
546<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>
548<blockquote>
548<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>
550</blockquote>
550</blockquote>
551<ol style="list-style-type: decimal">
551<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>
553</ol>
553</ol>
554<p>This paragraph should not be part of the note, as it is not indented.</p>
554<p>This paragraph should not be part of the note, as it is not indented.</p>
555<div class="footnotes">
555<div class="footnotes">