Muse reader: allow nested footnotes
This commit is contained in:
parent
73463b8239
commit
4d89a1db7f
2 changed files with 10 additions and 1 deletions
|
@ -821,7 +821,7 @@ footnote = try $ do
|
|||
Nothing -> return $ B.str $ "[" ++ ref ++ "]"
|
||||
Just (_pos, contents) -> do
|
||||
st <- askF
|
||||
let contents' = runF contents st { museNotes = M.empty }
|
||||
let contents' = runF contents st { museNotes = M.delete ref (museNotes st) }
|
||||
return $ B.note contents'
|
||||
|
||||
whitespace :: PandocMonad m => MuseParser m (F Inlines)
|
||||
|
|
|
@ -659,6 +659,15 @@ tests =
|
|||
] =?>
|
||||
para (text "Start recursion here" <>
|
||||
note (para "Recursion continues here[1]"))
|
||||
, "Nested footnotes" =:
|
||||
T.unlines [ "Footnote: [1]"
|
||||
, ""
|
||||
, "[1] Nested: [2]"
|
||||
, ""
|
||||
, "[2] No recursion: [1]"
|
||||
] =?>
|
||||
para (text "Footnote: " <>
|
||||
note (para (text "Nested: " <> note (para $ text "No recursion: [1]"))))
|
||||
, "No zero footnotes" =:
|
||||
T.unlines [ "Here is a footnote[0]."
|
||||
, ""
|
||||
|
|
Loading…
Add table
Reference in a new issue