FB2 writer: do not wrap note references into <sup> and brackets

Existing FB2 readers, such as FBReader, already display links with type="note" as a superscript.
This commit is contained in:
Alexander Krotov 2019-05-10 09:17:21 +03:00 committed by Alexander
parent f1fbec938f
commit 2e13c0a451
3 changed files with 6 additions and 18 deletions

View file

@ -439,7 +439,7 @@ toXml (Note bs) = do
let fn_id = footnoteID n
fn_desc <- cMapM blockToXml bs
modify (\s -> s { footnotes = (n, fn_id, fn_desc) : fns })
let fn_ref = el "sup" . txt $ "[" ++ show n ++ "]"
let fn_ref = txt $ "[" ++ show n ++ "]"
return . list $ el "a" ( [ attr ("l","href") ('#':fn_id)
, uattr "type" "note" ]
, fn_ref )

View file

@ -55,9 +55,7 @@ citatons.</p>
<empty-line />
<p>
<strikethrough>Strikeout</strikethrough> is Pandocs extension.
Superscript and subscripts too: H<sub>2</sub>O is a liquid<a l:href="#n1" type="note">
<sup>[1]</sup>
</a>.
Superscript and subscripts too: H<sub>2</sub>O is a liquid<a l:href="#n1" type="note">[1]</a>.
2<sup>10</sup> is 1024.</p>
<p>Math is another Pandoc extension: <code>E = m c^2</code>.</p>
</section>

View file

@ -696,25 +696,15 @@ So is pine.</p>
<title>
<p>Footnotes</p>
</title>
<p>Here is a footnote reference,<a l:href="#n1" type="note">
<sup>[1]</sup>
</a> and another.<a l:href="#n2" type="note">
<sup>[2]</sup>
</a>
<p>Here is a footnote reference,<a l:href="#n1" type="note">[1]</a> and another.<a l:href="#n2" type="note">[2]</a>
This should <emphasis>not</emphasis> be a footnote reference, because it
contains a space.[^my note] Here is an inline note.<a l:href="#n3" type="note">
<sup>[3]</sup>
</a>
contains a space.[^my note] Here is an inline note.<a l:href="#n3" type="note">[3]</a>
</p>
<cite>
<p>Notes can go in quotes.<a l:href="#n4" type="note">
<sup>[4]</sup>
</a>
<p>Notes can go in quotes.<a l:href="#n4" type="note">[4]</a>
</p>
</cite>
<p>1. And in list items.<a l:href="#n5" type="note">
<sup>[5]</sup>
</a>
<p>1. And in list items.<a l:href="#n5" type="note">[5]</a>
</p>
<p>This paragraph should not be part of the note, as it is not indented.</p>
</section>