From 3a22907306992f2dd1b6bcb548633734c0c9a1b1 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Sat, 6 Jan 2018 00:03:59 -0800
Subject: [PATCH] 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.
---
 src/Text/Pandoc/App.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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" ++