git.iko.soy/typeable/pandoc
on master help sign in
RST reader: Make directive labels case-insensitive.
commitd3601726932753f76919f2d052dcd01ce0b54986 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 29 Sep 2012, 21:42 (14 years ago) parent779e021
1 file changed+3−1
src/Text/Pandoc/Readers/RST.hs+3−1
src/Text/Pandoc/Readers/RST.hs+3−1
@@ -45,6 +45,7 @@ import Text.Pandoc.Builder (Inlines, Blocks, trimInlines, (<>))
4545import qualified Text.Pandoc.Builder as B
4646import Data.Monoid (mconcat, mempty)
4747import Data.Sequence (viewr, ViewR(..))
48+import Data.Char (toLower)
4849
4950-- | Parse reStructuredText string and return Pandoc document.
5051readRST :: ReaderOptions -- ^ Reader options
@@ -490,7 +491,8 @@ comment = try $ do
490491 return mempty
491492
492493directiveLabel :: RSTParser String
493−directiveLabel = many1Till (letter <|> char '-') (try $ string "::")
494+directiveLabel = map toLower
495+ <$> many1Till (letter <|> char '-') (try $ string "::")
494496
495497directive :: RSTParser Blocks
496498directive = try $ do