diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2019-05-10 09:17:21 +0300 |
---|---|---|
committer | Alexander <ilabdsf@gmail.com> | 2019-05-15 13:31:07 +0300 |
commit | 2e13c0a451fe87ebd1ef2c314f7f98c40f3ec422 (patch) | |
tree | 1605436f78a79b8de8149c86fb5b29c5b6e79326 | |
parent | f1fbec938f0df271845ca00eec17d95a896136f8 (diff) | |
download | pandoc-2e13c0a451fe87ebd1ef2c314f7f98c40f3ec422.tar.gz |
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.
-rw-r--r-- | src/Text/Pandoc/Writers/FB2.hs | 2 | ||||
-rw-r--r-- | test/fb2/basic.fb2 | 4 | ||||
-rw-r--r-- | test/writer.fb2 | 18 |
3 files changed, 6 insertions, 18 deletions
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index 950240df5..d2527a0a9 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -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 ) diff --git a/test/fb2/basic.fb2 b/test/fb2/basic.fb2 index dfea55b92..fd629dc56 100644 --- a/test/fb2/basic.fb2 +++ b/test/fb2/basic.fb2 @@ -55,9 +55,7 @@ citatons.</p> <empty-line /> <p> <strikethrough>Strikeout</strikethrough> is Pandoc’s 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> diff --git a/test/writer.fb2 b/test/writer.fb2 index 6f8c25cde..998048078 100644 --- a/test/writer.fb2 +++ b/test/writer.fb2 @@ -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> |