git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: fix indentation requirements for footnote continuations
commita71a1fec69104f35b3722e423a741dc68076f3db authorAlexander Krotov <ilabdsf@gmail.com> dateSat 3 Mar 2018, 03:32 (9 years ago) parent7507117
2 files changed+12−2
src/Text/Pandoc/Readers/Muse.hs+2−2 test/Tests/Readers/Muse.hs+10
src/Text/Pandoc/Readers/Muse.hs+2−2
@@ -470,10 +470,10 @@ amuseNoteBlockUntil :: PandocMonad m
470470 -> MuseParser m (F Blocks, a)
471471amuseNoteBlockUntil end = try $ do
472472 guardEnabled Ext_amuse
473− pos <- getPosition
474473 ref <- noteMarker <* spaceChar
474+ pos <- getPosition
475475 updateState (\st -> st { museInPara = False })
476− (content, e) <- listItemContentsUntil (sourceColumn pos) (fail "x") end
476+ (content, e) <- listItemContentsUntil (sourceColumn pos - 1) (fail "x") end
477477 oldnotes <- museNotes <$> getState
478478 case M.lookup ref oldnotes of
479479 Just _ -> logMessage $ DuplicateNoteReference ref pos
test/Tests/Readers/Muse.hs+10
@@ -637,6 +637,16 @@ tests =
637637 text " footnotes" <>
638638 note (para "Second footnote")) <>
639639 para (text "Not a note")
640+
641+ -- Verse requires precise indentation, so it is good to test indentation requirements
642+ , "Note continuation with verse" =:
643+ T.unlines [ "Foo[1]"
644+ , ""
645+ , "[1] Bar"
646+ , ""
647+ , " > Baz"
648+ ] =?>
649+ para ("Foo" <> note (para "Bar" <> lineBlock ["Baz"]))
640650 , test emacsMuse "Emacs multiparagraph footnotes"
641651 (T.unlines
642652 [ "First footnote reference[1] and second footnote reference[2]."