aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-12-17 10:21:30 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-12-17 10:21:30 -0800
commit90c820dc4e3d7e1db3813b953777d65ee74b2779 (patch)
treea1efa9b47e27d9b096d3c0737d4dc3daf55e4ca6 /src/Text
parent15d3cf80703769abc8443a73a56acae8c7f5687e (diff)
downloadpandoc-90c820dc4e3d7e1db3813b953777d65ee74b2779.tar.gz
Parsing: use safeRead instead of read.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Parsing.hs2
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