git.iko.soy/typeable/pandoc
on master help sign in
FB2 writer: do not wrap note references into <sup> and brackets
2e13c0aAlexander Krotov
src/Text/Pandoc/Writers/FB2.hs+1−1
@@ -439,7 +439,7 @@ toXml (Note bs) = do
439 let fn_id = footnoteID n
439 let fn_id = footnoteID n
440 fn_desc <- cMapM blockToXml bs
440 fn_desc <- cMapM blockToXml bs
441 modify (\s -> s { footnotes = (n, fn_id, fn_desc) : fns })
441 modify (\s -> s { footnotes = (n, fn_id, fn_desc) : fns })
442− let fn_ref = el "sup" . txt $ "[" ++ show n ++ "]"
442+ let fn_ref = txt $ "[" ++ show n ++ "]"
443 return . list $ el "a" ( [ attr ("l","href") ('#':fn_id)
443 return . list $ el "a" ( [ attr ("l","href") ('#':fn_id)
444 , uattr "type" "note" ]
444 , uattr "type" "note" ]
445 , fn_ref )
445 , fn_ref )
test/fb2/basic.fb2+1−3
@@ -55,9 +55,7 @@ citatons.</p>
55<empty-line />
55<empty-line />
56<p>
56<p>
57<strikethrough>Strikeout</strikethrough> is Pandoc’s extension.
57<strikethrough>Strikeout</strikethrough> is Pandoc’s extension.
58−Superscript and subscripts too: H<sub>2</sub>O is a liquid<a l:href="#n1" type="note">
58+Superscript and subscripts too: H<sub>2</sub>O is a liquid<a l:href="#n1" type="note">[1]</a>.
59−<sup>[1]</sup>
60−</a>.
612<sup>10</sup> is 1024.</p>
592<sup>10</sup> is 1024.</p>
62<p>Math is another Pandoc extension: <code>E = m c^2</code>.</p>
60<p>Math is another Pandoc extension: <code>E = m c^2</code>.</p>
63</section>
61</section>
test/writer.fb2+4−14
@@ -696,25 +696,15 @@ So is ‘pine.’</p>
696<title>
696<title>
697<p>Footnotes</p>
697<p>Footnotes</p>
698</title>
698</title>
699−<p>Here is a footnote reference,<a l:href="#n1" type="note">
699+<p>Here is a footnote reference,<a l:href="#n1" type="note">[1]</a> and another.<a l:href="#n2" type="note">[2]</a>
700−<sup>[1]</sup>
701−</a> and another.<a l:href="#n2" type="note">
702−<sup>[2]</sup>
703−</a>
704This should <emphasis>not</emphasis> be a footnote reference, because it
700This should <emphasis>not</emphasis> be a footnote reference, because it
705−contains a space.[^my note] Here is an inline note.<a l:href="#n3" type="note">
701+contains a space.[^my note] Here is an inline note.<a l:href="#n3" type="note">[3]</a>
706−<sup>[3]</sup>
707−</a>
708</p>
702</p>
709<cite>
703<cite>
710−<p>Notes can go in quotes.<a l:href="#n4" type="note">
704+<p>Notes can go in quotes.<a l:href="#n4" type="note">[4]</a>
711−<sup>[4]</sup>
712−</a>
713</p>
705</p>
714</cite>
706</cite>
715−<p>1. And in list items.<a l:href="#n5" type="note">
707+<p>1. And in list items.<a l:href="#n5" type="note">[5]</a>
716−<sup>[5]</sup>
717−</a>
718</p>
708</p>
719<p>This paragraph should not be part of the note, as it is not indented.</p>
709<p>This paragraph should not be part of the note, as it is not indented.</p>
720</section>
710</section>