@@ -262,13 +262,13 @@ parseBlocks =
262262 try paraStart
263263 where
264264 parseEnd = mempty <$ eof
265− blockStart = do first <- header <|> blockElements <|> amuseNoteBlock <|> emacsNoteBlock
265+ blockStart = do first <- header <|> blockElements <|> emacsNoteBlock
266266 rest <- parseBlocks
267267 return $ first B.<> rest
268268 listStart = do
269269 st <- getState
270270 setState $ st{ museInPara = False }
271− (first, rest) <- anyListUntil parseBlocks
271+ (first, rest) <- anyListUntil parseBlocks <|> amuseNoteBlockUntil parseBlocks
272272 return $ first B.<> rest
273273 paraStart = do
274274 indent <- length <$> many spaceChar
@@ -489,20 +489,22 @@ noteMarker = try $ do
489489
490490-- Amusewiki version of note
491491-- Parsing is similar to list item, except that note marker is used instead of list marker
492−amuseNoteBlock :: PandocMonad m => MuseParser m (F Blocks)
493−amuseNoteBlock = try $ do
492+amuseNoteBlockUntil :: PandocMonad m
493+ => MuseParser m a
494+ -> MuseParser m (F Blocks, a)
495+amuseNoteBlockUntil end = try $ do
494496 guardEnabled Ext_amuse
495497 pos <- getPosition
496498 ref <- noteMarker <* spaceChar
497499 st <- getState
498500 setState $ st{ museInPara = False }
499− content <- listItemContents
501+ (content, e) <- listItemContentsUntil (sourceColumn pos) (fail "x") end
500502 oldnotes <- museNotes <$> getState
501503 case M.lookup ref oldnotes of
502504 Just _ -> logMessage $ DuplicateNoteReference ref pos
503505 Nothing -> return ()
504506 updateState $ \s -> s{ museNotes = M.insert ref (pos, content) oldnotes }
505− return mempty
507+ return (mempty, e)
506508
507509-- Emacs version of note
508510-- Notes are allowed only at the end of text, no indentation is required.
@@ -573,12 +575,6 @@ bulletListUntil end = try $ do
573575 (items, e) <- bulletListItemsUntil indent end
574576 return (B.bulletList <$> sequence items, e)
575577
576−listItemContents :: PandocMonad m => MuseParser m (F Blocks)
577−listItemContents = do
578− pos <- getPosition
579− let col = sourceColumn pos - 1
580− mconcat <$> parseBlock `sepBy1` try (skipMany blankline >> indentWith col)
581−
582578-- | Parses an ordered list marker and returns list attributes.
583579anyMuseOrderedListMarker :: PandocMonad m => MuseParser m ListAttributes
584580anyMuseOrderedListMarker = do