From 2e13c0a451fe87ebd1ef2c314f7f98c40f3ec422 Mon Sep 17 00:00:00 2001
From: Alexander Krotov
Date: Fri, 10 May 2019 09:17:21 +0300
Subject: FB2 writer: do not wrap note references into and brackets
Existing FB2 readers, such as FBReader, already display links with type="note" as a superscript.
---
src/Text/Pandoc/Writers/FB2.hs | 2 +-
test/fb2/basic.fb2 | 4 +---
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.
Strikeout is Pandoc’s extension.
-Superscript and subscripts too: H2O is a liquid
-[1]
-.
+Superscript and subscripts too: H2O is a liquid[1].
210 is 1024.
Math is another Pandoc extension: E = m c^2
.
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.’
Footnotes
-Here is a footnote reference,
-[1]
- and another.
-[2]
-
+
Here is a footnote reference,[1] and another.[2]
This should not be a footnote reference, because it
-contains a space.[^my note] Here is an inline note.
-[3]
-
+contains a space.[^my note] Here is an inline note.[3]
-Notes can go in quotes.
-[4]
-
+
Notes can go in quotes.[4]
-1. And in list items.
-[5]
-
+
1. And in list items.[5]
This paragraph should not be part of the note, as it is not indented.
--
cgit v1.2.3