@@ -31,7 +31,6 @@ Conversion of Muse text to 'Pandoc' document.
33- Page breaks (five "*")
33- Page breaks (five "*")
34−- Headings with anchors (make it round trip with Muse writer)
35- Org tables
34- Org tables
36- table.el tables
35- table.el tables
37- Images with attributes (floating and width)
36- Images with attributes (floating and width)
@@ -241,7 +240,8 @@ header = try $ do
241 guard $ level <= 5
240 guard $ level <= 5
242 spaceChar
241 spaceChar
243 content <- trimInlinesF . mconcat <$> manyTill inline eol
242 content <- trimInlinesF . mconcat <$> manyTill inline eol
243+ anchorId <- option "" parseAnchor
244− attr <- registerHeader ("", [], []) (runF content defaultParserState)
244+ attr <- registerHeader (anchorId, [], []) (runF content defaultParserState)
245 return $ B.headerWith attr level <$> content
245 return $ B.headerWith attr level <$> content
247example :: PandocMonad m => MuseParser m (F Blocks)
247example :: PandocMonad m => MuseParser m (F Blocks)
@@ -629,14 +629,18 @@ endline = try $ do
629 notFollowedBy blankline
629 notFollowedBy blankline
630 returnF B.softbreak
630 returnF B.softbreak
632−anchor :: PandocMonad m => MuseParser m (F Inlines)
632+parseAnchor :: PandocMonad m => MuseParser m String
633−anchor = try $ do
633+parseAnchor = try $ do
634 getPosition >>= \pos -> guard (sourceColumn pos == 1)
634 getPosition >>= \pos -> guard (sourceColumn pos == 1)
636 first <- letter
636 first <- letter
637 rest <- many (letter <|> digit)
637 rest <- many (letter <|> digit)
638 skipMany spaceChar <|> void newline
638 skipMany spaceChar <|> void newline
639− let anchorId = first:rest
639+ return $ first:rest
641+anchor :: PandocMonad m => MuseParser m (F Inlines)
643+ anchorId <- parseAnchor
640 return $ return $ B.spanWith (anchorId, [], []) mempty
644 return $ return $ B.spanWith (anchorId, [], []) mempty
642footnote :: PandocMonad m => MuseParser m (F Inlines)
646footnote :: PandocMonad m => MuseParser m (F Inlines)