summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-12-21 23:43:05 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2016-12-21 23:51:15 +0100
commitd27188ad309feb9a76f6dc3d816ad78722078fe1 (patch)
tree99df4307c0f060ac9c847a4999f99f66e95fd56c
parentb5ce9635caa6dac47ef015230736061c5916cdd4 (diff)
Org writer: prefix footnote numbers with `fn:`
Unprefixed numbers where used by older org-mode versions, but are no longer supported.
-rw-r--r--src/Text/Pandoc/Writers/Org.hs4
-rw-r--r--tests/writer.org38
2 files changed, 21 insertions, 21 deletions
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
index a2f20d830..4302459cc 100644
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -92,7 +92,7 @@ notesToOrg notes =
noteToOrg :: Int -> [Block] -> State WriterState Doc
noteToOrg num note = do
contents <- blockListToOrg note
- let marker = "[" ++ show num ++ "] "
+ let marker = "[fn:" ++ show num ++ "] "
return $ hang (length marker) (text marker) contents
-- | Escape special characters for Org.
@@ -373,7 +373,7 @@ inlineToOrg (Note contents) = do
notes <- get >>= (return . stNotes)
modify $ \st -> st { stNotes = contents:notes }
let ref = show $ (length notes) + 1
- return $ "[" <> text ref <> "]"
+ return $ "[fn:" <> text ref <> "]"
orgPath :: String -> String
orgPath src =
diff --git a/tests/writer.org b/tests/writer.org
index f8011e644..92f130054 100644
--- a/tests/writer.org
+++ b/tests/writer.org
@@ -819,37 +819,37 @@ Here is a movie [[file:movie.jpg]] icon.
:CUSTOM_ID: footnotes
:END:
-Here is a footnote reference,[1] and another.[2] This should /not/ be a
+Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
footnote reference, because it contains a space.[\^my note] Here is an inline
-note.[3]
+note.[fn:3]
#+BEGIN_QUOTE
- Notes can go in quotes.[4]
+ Notes can go in quotes.[fn:4]
#+END_QUOTE
-1. And in list items.[5]
+1. And in list items.[fn:5]
This paragraph should not be part of the note, as it is not indented.
-[1] Here is the footnote. It can go anywhere after the footnote reference. It
- need not be placed at the end of the document.
+[fn:1] Here is the footnote. It can go anywhere after the footnote reference.
+ It need not be placed at the end of the document.
-[2] Here's the long note. This one contains multiple blocks.
+[fn:2] Here's the long note. This one contains multiple blocks.
- Subsequent blocks are indented to show that they belong to the footnote
- (as with list items).
+ Subsequent blocks are indented to show that they belong to the footnote
+ (as with list items).
- #+BEGIN_EXAMPLE
- { <code> }
- #+END_EXAMPLE
+ #+BEGIN_EXAMPLE
+ { <code> }
+ #+END_EXAMPLE
- If you want, you can indent every line, but you can also be lazy and just
- indent the first line of each block.
+ If you want, you can indent every line, but you can also be lazy and
+ just indent the first line of each block.
-[3] This is /easier/ to type. Inline notes may contain
- [[http://google.com][links]] and =]= verbatim characters, as well as
- [bracketed text].
+[fn:3] This is /easier/ to type. Inline notes may contain
+ [[http://google.com][links]] and =]= verbatim characters, as well as
+ [bracketed text].
-[4] In quote.
+[fn:4] In quote.
-[5] In list.
+[fn:5] In list.