Muse reader: allow "-" in anchors
This commit is contained in:
parent
bc9d296e5a
commit
ce4326a4f1
2 changed files with 6 additions and 1 deletions
|
@ -801,7 +801,7 @@ parseAnchor :: PandocMonad m => MuseParser m String
|
|||
parseAnchor = try $ do
|
||||
getPosition >>= \pos -> guard (sourceColumn pos == 1)
|
||||
char '#'
|
||||
(:) <$> letter <*> many (letter <|> digit)
|
||||
(:) <$> letter <*> many (letter <|> digit <|> char '-')
|
||||
|
||||
anchor :: PandocMonad m => MuseParser m (F Inlines)
|
||||
anchor = try $ do
|
||||
|
|
|
@ -637,6 +637,11 @@ tests =
|
|||
, "#anchor and ends here."
|
||||
] =?>
|
||||
para ("Paragraph starts here\n" <> spanWith ("anchor", [], []) mempty <> "and ends here.")
|
||||
, "Anchor with \"-\"" =:
|
||||
T.unlines [ "; A comment to make sure anchor is not parsed as a directive"
|
||||
, "#anchor-id Target"
|
||||
] =?>
|
||||
para (spanWith ("anchor-id", [], []) mempty <> "Target")
|
||||
]
|
||||
, testGroup "Footnotes"
|
||||
[ "Simple footnote" =:
|
||||
|
|
Loading…
Add table
Reference in a new issue