git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: allow nested footnotes
commit4d89a1db7f1ad9d64db7c9e2c294351821ff3993 authorAlexander Krotov <ilabdsf@gmail.com> dateThu 26 Apr 2018, 12:29 (9 years ago) parent73463b8
2 files changed+10−1
src/Text/Pandoc/Readers/Muse.hs+1−1 test/Tests/Readers/Muse.hs+9
src/Text/Pandoc/Readers/Muse.hs+1−1
@@ -821,7 +821,7 @@ footnote = try $ do
821821 Nothing -> return $ B.str $ "[" ++ ref ++ "]"
822822 Just (_pos, contents) -> do
823823 st <- askF
824− let contents' = runF contents st { museNotes = M.empty }
824+ let contents' = runF contents st { museNotes = M.delete ref (museNotes st) }
825825 return $ B.note contents'
826826
827827whitespace :: PandocMonad m => MuseParser m (F Inlines)
test/Tests/Readers/Muse.hs+9
@@ -659,6 +659,15 @@ tests =
659659 ] =?>
660660 para (text "Start recursion here" <>
661661 note (para "Recursion continues here[1]"))
662+ , "Nested footnotes" =:
663+ T.unlines [ "Footnote: [1]"
664+ , ""
665+ , "[1] Nested: [2]"
666+ , ""
667+ , "[2] No recursion: [1]"
668+ ] =?>
669+ para (text "Footnote: " <>
670+ note (para (text "Nested: " <> note (para $ text "No recursion: [1]"))))
662671 , "No zero footnotes" =:
663672 T.unlines [ "Here is a footnote[0]."
664673 , ""