From 2c3fc36305d1d001871ee8f05bdb7f56a306a7e9 Mon Sep 17 00:00:00 2001 From: Evan Silberman Date: Thu, 19 Dec 2024 18:43:24 -0800 Subject: [PATCH] Correct example in charsInBalanced The given example wasn't actually functional because `anyChar` parses a `Char` and `charsInBalanced` wants a `Text` parser as its inner parser. --- src/Text/Pandoc/Parsing/General.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Parsing/General.hs b/src/Text/Pandoc/Parsing/General.hs index 60cab354ecc7..e306f7fc6e6c 100644 --- a/src/Text/Pandoc/Parsing/General.hs +++ b/src/Text/Pandoc/Parsing/General.hs @@ -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