Org writer: prefix footnote numbers with fn:

Unprefixed numbers where used by older org-mode versions, but are no
longer supported.
This commit is contained in:
Albert Krewinkel 2016-12-21 23:43:05 +01:00
parent b5ce9635ca
commit d27188ad30
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
2 changed files with 21 additions and 21 deletions

View file

@ -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 =

View file

@ -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.