summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc.hs')
-rw-r--r--src/Text/Pandoc.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs
index b65e7130d..6a019bc3f 100644
--- a/src/Text/Pandoc.hs
+++ b/src/Text/Pandoc.hs
@@ -135,6 +135,7 @@ import Text.Pandoc.Writers.Org
import Text.Pandoc.Writers.AsciiDoc
import Text.Pandoc.Templates
import Text.Pandoc.Options
+import Text.Pandoc.Shared (safeRead)
import Data.ByteString.Lazy (ByteString)
import Data.Version (showVersion)
import Text.JSON.Generic
@@ -158,10 +159,9 @@ parseFormatSpec = parse formatSpec ""
extMod = do
polarity <- oneOf "-+"
name <- many1 $ noneOf "-+"
- ext <- case reads name of
- ((n,[]):_) -> return n
- _ -> unexpected $ "Unknown extension: " ++
- name
+ ext <- case safeRead name of
+ Just n -> return n
+ Nothing -> unexpected $ "Unknown extension: " ++ name
return $ case polarity of
'-' -> Set.delete ext
_ -> Set.insert ext