@@ -363,12 +363,12 @@ separator = try $ do
363363
364364header :: PandocMonad m => MuseParser m (F Blocks)
365365header = try $ do
366+ anchorId <- option "" $ try (parseAnchor <* manyTill spaceChar eol)
366367 getPosition >>= \pos -> guard (sourceColumn pos == 1)
367368 level <- fmap length $ many1 $ char '*'
368369 guard $ level <= 5
369370 spaceChar
370371 content <- trimInlinesF . mconcat <$> manyTill inline eol
371− anchorId <- option "" parseAnchor
372372 attr <- registerHeader (anchorId, [], []) (runF content def)
373373 return $ B.headerWith attr level <$> content
374374
@@ -781,12 +781,12 @@ parseAnchor = try $ do
781781 char '#'
782782 first <- letter
783783 rest <- many (letter <|> digit)
784− skipMany spaceChar <|> void newline
785784 return $ first:rest
786785
787786anchor :: PandocMonad m => MuseParser m (F Inlines)
788787anchor = try $ do
789788 anchorId <- parseAnchor
789+ skipMany spaceChar <|> void newline
790790 return $ return $ B.spanWith (anchorId, [], []) mempty
791791
792792footnote :: PandocMonad m => MuseParser m (F Inlines)