Parsing: use safeRead instead of read.
commit90c820dc4e3d7e1db3813b953777d65ee74b2779
authorJohn MacFarlane <jgm@berkeley.edu>
dateMon 17 Dec 2018, 10:21 (8 years ago)
parent15d3cf8
src/Text/Pandoc/Parsing.hs+1−1
@@ -736,7 +736,7 @@ lowerRoman = do
736736decimal :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)
737737decimal = do
738738 num <- many1 digit
739− return (Decimal, read num)
739+ return (Decimal, fromMaybe 1 $ safeRead num)
740740
741741-- | Parses a '@' and optional label and
742742-- returns (DefaultStyle, [next example number]). The next