git.iko.soy/typeable/pandoc
on master help sign in
Org writer: prefix footnote numbers with `fn:`
d27188aAlbert Krewinkel
src/Text/Pandoc/Writers/Org.hs+2−2
@@ -92,7 +92,7 @@ notesToOrg notes =
92noteToOrg :: Int -> [Block] -> State WriterState Doc
92noteToOrg :: Int -> [Block] -> State WriterState Doc
93noteToOrg num note = do
93noteToOrg num note = do
94 contents <- blockListToOrg note
94 contents <- blockListToOrg note
95− let marker = "[" ++ show num ++ "] "
95+ let marker = "[fn:" ++ show num ++ "] "
96 return $ hang (length marker) (text marker) contents
96 return $ hang (length marker) (text marker) contents
97
97
98-- | Escape special characters for Org.
98-- | Escape special characters for Org.
@@ -373,7 +373,7 @@ inlineToOrg (Note contents) = do
373 notes <- get >>= (return . stNotes)
373 notes <- get >>= (return . stNotes)
374 modify $ \st -> st { stNotes = contents:notes }
374 modify $ \st -> st { stNotes = contents:notes }
375 let ref = show $ (length notes) + 1
375 let ref = show $ (length notes) + 1
376− return $ "[" <> text ref <> "]"
376+ return $ "[fn:" <> text ref <> "]"
377
377
378orgPath :: String -> String
378orgPath :: String -> String
379orgPath src =
379orgPath src =
tests/writer.org+19−19
@@ -819,37 +819,37 @@ Here is a movie [[file:movie.jpg]] icon.
819 :CUSTOM_ID: footnotes
819 :CUSTOM_ID: footnotes
820 :END:
820 :END:
821
821
822−Here is a footnote reference,[1] and another.[2] This should /not/ be a
822+Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
823footnote reference, because it contains a space.[\^my note] Here is an inline
823footnote reference, because it contains a space.[\^my note] Here is an inline
824−note.[3]
824+note.[fn:3]
825
825
826#+BEGIN_QUOTE
826#+BEGIN_QUOTE
827− Notes can go in quotes.[4]
827+ Notes can go in quotes.[fn:4]
828#+END_QUOTE
828#+END_QUOTE
829
829
830−1. And in list items.[5]
830+1. And in list items.[fn:5]
831
831
832This paragraph should not be part of the note, as it is not indented.
832This paragraph should not be part of the note, as it is not indented.
833
833
834−[1] Here is the footnote. It can go anywhere after the footnote reference. It
834+[fn:1] Here is the footnote. It can go anywhere after the footnote reference.
835− need not be placed at the end of the document.
835+ It need not be placed at the end of the document.
836
836
837−[2] Here's the long note. This one contains multiple blocks.
837+[fn:2] Here's the long note. This one contains multiple blocks.
838
838
839− Subsequent blocks are indented to show that they belong to the footnote
839+ Subsequent blocks are indented to show that they belong to the footnote
840− (as with list items).
840+ (as with list items).
841
841
842− #+BEGIN_EXAMPLE
842+ #+BEGIN_EXAMPLE
843− { <code> }
843+ { <code> }
844− #+END_EXAMPLE
844+ #+END_EXAMPLE
845
845
846− If you want, you can indent every line, but you can also be lazy and just
846+ If you want, you can indent every line, but you can also be lazy and
847− indent the first line of each block.
847+ just indent the first line of each block.
848
848
849−[3] This is /easier/ to type. Inline notes may contain
849+[fn:3] This is /easier/ to type. Inline notes may contain
850− [[http://google.com][links]] and =]= verbatim characters, as well as
850+ [[http://google.com][links]] and =]= verbatim characters, as well as
851− [bracketed text].
851+ [bracketed text].
852
852
853−[4] In quote.
853+[fn:4] In quote.
854
854
855−[5] In list.
855+[fn:5] In list.