diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-12-17 10:21:30 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-12-17 10:21:30 -0800 |
commit | 90c820dc4e3d7e1db3813b953777d65ee74b2779 (patch) | |
tree | a1efa9b47e27d9b096d3c0737d4dc3daf55e4ca6 /src | |
parent | 15d3cf80703769abc8443a73a56acae8c7f5687e (diff) | |
download | pandoc-90c820dc4e3d7e1db3813b953777d65ee74b2779.tar.gz |
Parsing: use safeRead instead of read.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |