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.
This commit is contained in:
John MacFarlane 2018-01-06 00:03:59 -08:00
parent 0d935bd081
commit 3a22907306

View file

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