aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-11-21 08:46:01 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-11-21 08:46:01 -0800
commitc5b9ae3060e4bd767945f012a7e5ca9d63e92211 (patch)
treed634d60e3bcec136bcdcbd5344030c5b75645b6a /src
parent99bc204e8bfaaa391fe8f4912d7331c7d670e87d (diff)
downloadpandoc-c5b9ae3060e4bd767945f012a7e5ca9d63e92211.tar.gz
ImageSize: use safeRead instead of readMaybe.
readMaybe is only provided in base 4.6+.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/ImageSize.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs
index 5c775c908..571fdd665 100644
--- a/src/Text/Pandoc/ImageSize.hs
+++ b/src/Text/Pandoc/ImageSize.hs
@@ -56,7 +56,6 @@ import Data.Binary.Get
import Text.Pandoc.Shared (safeRead, hush)
import Data.Default (Default)
import Numeric (showFFloat)
-import Text.Read (readMaybe)
import Text.Pandoc.Definition
import Text.Pandoc.Options
import qualified Data.Map as M
@@ -185,7 +184,7 @@ showInPixel opts dim =
numUnit :: String -> Maybe (Double, String)
numUnit s =
let (nums, unit) = span (\c -> isDigit c || ('.'==c)) s
- in case readMaybe nums of
+ in case safeRead nums of
Just n -> Just (n, unit)
Nothing -> Nothing