Skip to content

Commit

Permalink
Correct example in charsInBalanced
Browse files Browse the repository at this point in the history
The given example wasn't actually functional because `anyChar` parses a
`Char` and `charsInBalanced` wants a `Text` parser as its inner parser.
  • Loading branch information
silby committed Dec 20, 2024
1 parent 4c409e6 commit 2c3fc36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Text/Pandoc/Parsing/General.hs
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ lineClump = blanklines
-- | Parse a string of characters between an open character
-- and a close character, including text between balanced
-- pairs of open and close, which must be different. For example,
-- @charsInBalanced '(' ')' anyChar@ will parse "(hello (there))"
-- and return "hello (there)".
-- @charsInBalanced '(' ')' (Data.Text.singleton <$> anyChar)@ will parse
-- "(hello (there))" and return "hello (there)".
charsInBalanced :: (Stream s m Char, UpdateSourcePos s Char)
=> Char -> Char -> ParsecT s st m Text -> ParsecT s st m Text
charsInBalanced open close parser = try $ do
Expand Down

0 comments on commit 2c3fc36

Please sign in to comment.