git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: correctly remove indentation from notes

Exactly one space is required and considered to be part of the marker.

commit7751391fce9a51066e02ecbe3677e69224c2161d authorAlexander Krotov <ilabdsf@gmail.com> dateWed 29 Nov 2017, 05:09 (9 years ago) parent0105a3c
2 files changed+10−2
src/Text/Pandoc/Readers/Muse.hs+2−2 test/Tests/Readers/Muse.hs+8
src/Text/Pandoc/Readers/Muse.hs+2−2
@@ -318,8 +318,8 @@ amuseNoteBlock :: PandocMonad m => MuseParser m (F Blocks)
318318amuseNoteBlock = try $ do
319319 guardEnabled Ext_amuse
320320 pos <- getPosition
321− ref <- noteMarker <* skipSpaces
322− content <- listItemContents $ 2 + length ref
321+ ref <- noteMarker <* spaceChar
322+ content <- listItemContents $ 3 + length ref
323323 oldnotes <- stateNotes' <$> getState
324324 case M.lookup ref oldnotes of
325325 Just _ -> logMessage $ DuplicateNoteReference ref pos
test/Tests/Readers/Muse.hs+8
@@ -385,6 +385,14 @@ tests =
385385 , " </example>"
386386 ] =?>
387387 definitionList [ ("term", [codeBlock "foo" <> para "bar" <> codeBlock "baz"]) ]
388+ , "Example inside note" =:
389+ T.unlines [ "Foo[1]"
390+ , ""
391+ , "[1] <example>"
392+ , " bar"
393+ , " </example>"
394+ ] =?>
395+ para ("Foo" <> note (codeBlock "bar"))
388396 ]
389397 , testGroup "Literal blocks"
390398 [ test emacsMuse "Literal block"