Muse reader: allow footnotes to start with empty line

A space character was required after footnote marker, now newline is allowed.
This commit is contained in:
Alexander Krotov 2018-10-22 03:03:11 +03:00
parent 95b9d94092
commit 875e33ecf6
2 changed files with 20 additions and 2 deletions

View file

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

View file

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