diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-10-22 03:03:11 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-10-22 03:05:17 +0300 |
commit | 875e33ecf698396418d722d77f74cf07835058d2 (patch) | |
tree | 09635e3709e6b789eecaf0a92fed579bfa7935e5 | |
parent | 95b9d940923c066630d0de822bf6f509e7f83db2 (diff) | |
download | pandoc-875e33ecf698396418d722d77f74cf07835058d2.tar.gz |
Muse reader: allow footnotes to start with empty line
A space character was required after footnote marker, now newline is allowed.
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 5 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 9b48c70aa..bc3bb921e 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -492,9 +492,10 @@ amuseNoteBlockUntil :: PandocMonad m -> MuseParser m (F Blocks, a) amuseNoteBlockUntil end = try $ do guardEnabled Ext_amuse - ref <- noteMarker <* spaceChar + ref <- noteMarker pos <- getPosition - (content, e) <- allowPara $ listItemContentsUntil (sourceColumn pos - 1) (fail "x") end + void spaceChar <|> lookAhead eol + (content, e) <- allowPara $ listItemContentsUntil (sourceColumn pos) (fail "x") end addNote ref pos content return (mempty, e) diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index ab0579519..36724b33c 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -797,6 +797,23 @@ tests = , "baz" ] =?> para (str "Foo" <> note (lineBlock ["bar"])) <> para (str "baz") + + , "Footnote starting with empty line" =: + T.unlines [ "Foo[1]" + , "" + , "[1]" -- No space character after note marker + , "" + , " Bar" + ] =?> + para (str "Foo" <> note (para $ text "Bar")) + , "Indentation in footnote starting with empty line" =: + T.unlines [ "Foo[1]" + , "" + , "[1]" -- No space character after note marker + , "" + , " Bar" + ] =?> + para (str "Foo" <> note mempty) <> blockQuote (para $ text "Bar") , test emacsMuse "Emacs multiparagraph footnotes" (T.unlines [ "First footnote reference[1] and second footnote reference[2]." |