From 90c820dc4e3d7e1db3813b953777d65ee74b2779 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 17 Dec 2018 10:21:30 -0800 Subject: Parsing: use safeRead instead of read. --- src/Text/Pandoc/Parsing.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index a5588e4f1..20c9bdb9b 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -736,7 +736,7 @@ lowerRoman = do decimal :: Stream s m Char => ParserT s st m (ListNumberStyle, Int) decimal = do num <- many1 digit - return (Decimal, read num) + return (Decimal, fromMaybe 1 $ safeRead num) -- | Parses a '@' and optional label and -- returns (DefaultStyle, [next example number]). The next -- cgit v1.2.3