diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 4 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 46dcf38d9..1ea78676b 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -336,7 +336,9 @@ para = do noteMarker :: PandocMonad m => MuseParser m String noteMarker = try $ do char '[' - many1Till digit $ char ']' + first <- oneOf "123456789" + rest <- manyTill digit (char ']') + return $ first:rest -- Amusewiki version of note -- Parsing is similar to list item, except that note marker is used instead of list marker diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 41d1d9710..513b54a65 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -505,6 +505,20 @@ tests = ] =?> para (text "Start recursion here" <> note (para "Recursion continues here[1]")) + , "No zero footnotes" =: + T.unlines [ "Here is a footnote[0]." + , "" + , "[0] Footnote contents" + ] =?> + para "Here is a footnote[0]." <> + para "[0] Footnote contents" + , "Footnotes can't start with zero" =: + T.unlines [ "Here is a footnote[01]." + , "" + , "[01] Footnote contents" + ] =?> + para "Here is a footnote[01]." <> + para "[01] Footnote contents" , testGroup "Multiparagraph footnotes" [ "Amusewiki multiparagraph footnotes" =: T.unlines [ "Multiparagraph[1] footnotes[2]" |