git.iko.soy/typeable/pandoc
on master help sign in
Parsing: use safeRead instead of read.
90c820dJohn MacFarlane
src/Text/Pandoc/Parsing.hs+1−1
@@ -736,7 +736,7 @@ lowerRoman = do
736decimal :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)
736decimal :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)
737decimal = do
737decimal = do
738 num <- many1 digit
738 num <- many1 digit
739− return (Decimal, read num)
739+ return (Decimal, fromMaybe 1 $ safeRead num)
740
740
741-- | Parses a '@' and optional label and
741-- | Parses a '@' and optional label and
742-- returns (DefaultStyle, [next example number]). The next
742-- returns (DefaultStyle, [next example number]). The next