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:
parent
95b9d94092
commit
875e33ecf6
2 changed files with 20 additions and 2 deletions
|
@ -492,9 +492,10 @@ amuseNoteBlockUntil :: PandocMonad m
|
||||||
-> MuseParser m (F Blocks, a)
|
-> MuseParser m (F Blocks, a)
|
||||||
amuseNoteBlockUntil end = try $ do
|
amuseNoteBlockUntil end = try $ do
|
||||||
guardEnabled Ext_amuse
|
guardEnabled Ext_amuse
|
||||||
ref <- noteMarker <* spaceChar
|
ref <- noteMarker
|
||||||
pos <- getPosition
|
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
|
addNote ref pos content
|
||||||
return (mempty, e)
|
return (mempty, e)
|
||||||
|
|
||||||
|
|
|
@ -797,6 +797,23 @@ tests =
|
||||||
, "baz"
|
, "baz"
|
||||||
] =?>
|
] =?>
|
||||||
para (str "Foo" <> note (lineBlock ["bar"])) <> para (str "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"
|
, test emacsMuse "Emacs multiparagraph footnotes"
|
||||||
(T.unlines
|
(T.unlines
|
||||||
[ "First footnote reference[1] and second footnote reference[2]."
|
[ "First footnote reference[1] and second footnote reference[2]."
|
||||||
|
|
Loading…
Add table
Reference in a new issue