aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-01-06 00:03:59 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-01-06 00:33:34 -0800
commit3a22907306992f2dd1b6bcb548633734c0c9a1b1 (patch)
tree913f751fd62f6c8df35c406b294eb47ac7bb1466 /src/Text
parent0d935bd081bb4013168dc114461ab7c47fec2f44 (diff)
downloadpandoc-3a22907306992f2dd1b6bcb548633734c0c9a1b1.tar.gz
Don't use `missingIncludes` unless custom syntax defs have been given.
This avoids a huge performance sink that comes from evaluating all the elements of the default syntax map. Better just to have run-time errors for missing includes? See #4226.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/App.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index c759df46c..fc0a911ea 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -268,7 +268,8 @@ convertWithOpts opts = do
syntaxMap <- foldM addSyntaxMap defaultSyntaxMap
(optSyntaxDefinitions opts)
- case missingIncludes (M.elems syntaxMap) of
+ unless (null (optSyntaxDefinitions opts)) $
+ case missingIncludes (M.elems syntaxMap) of
[] -> return ()
xs -> E.throwIO $ PandocSyntaxMapError $
"Missing syntax definitions:\n" ++