git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: allow "-" in anchors
commitce4326a4f12180844532febf93261f098cd6c5aa authorAlexander Krotov <ilabdsf@gmail.com> dateThu 19 Apr 2018, 14:17 (9 years ago) parentbc9d296
2 files changed+6−1
src/Text/Pandoc/Readers/Muse.hs+1−1 test/Tests/Readers/Muse.hs+5
src/Text/Pandoc/Readers/Muse.hs+1−1
@@ -801,7 +801,7 @@ parseAnchor :: PandocMonad m => MuseParser m String
801801parseAnchor = try $ do
802802 getPosition >>= \pos -> guard (sourceColumn pos == 1)
803803 char '#'
804− (:) <$> letter <*> many (letter <|> digit)
804+ (:) <$> letter <*> many (letter <|> digit <|> char '-')
805805
806806anchor :: PandocMonad m => MuseParser m (F Inlines)
807807anchor = try $ do
test/Tests/Readers/Muse.hs+5
@@ -637,6 +637,11 @@ tests =
637637 , "#anchor and ends here."
638638 ] =?>
639639 para ("Paragraph starts here\n" <> spanWith ("anchor", [], []) mempty <> "and ends here.")
640+ , "Anchor with \"-\"" =:
641+ T.unlines [ "; A comment to make sure anchor is not parsed as a directive"
642+ , "#anchor-id Target"
643+ ] =?>
644+ para (spanWith ("anchor-id", [], []) mempty <> "Target")
640645 ]
641646 , testGroup "Footnotes"
642647 [ "Simple footnote" =: