From ae6ba1533bbe79bc82d2b3fc47dc3cde55bf7370 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 7 Jan 2018 18:41:01 -0800 Subject: Use latest skylighting and omit the 'missingincludes' check. If you use a custom syntax definition that refers to a syntax you haven't loaded, pandoc will now complain when it is highlighting the text, rather than at the start. This saves a huge performance hit from the `missingIncludes` check. Closes #4226. --- src/Text/Pandoc/App.hs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index fc0a911ea..ed16b07a5 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -71,8 +71,7 @@ import Data.Aeson.Encode.Pretty (encodePretty', Config(..), keyOrder, defConfig, Indent(..), NumberFormat(..)) import Skylighting (Style, Syntax (..), defaultSyntaxMap, parseTheme, pygments) -import Skylighting.Parser (addSyntaxDefinition, missingIncludes, - parseSyntaxDefinition) +import Skylighting.Parser (addSyntaxDefinition, parseSyntaxDefinition) import System.Console.GetOpt import System.Directory (Permissions (..), doesFileExist, findExecutable, getAppUserDataDirectory, getPermissions) @@ -268,15 +267,6 @@ convertWithOpts opts = do syntaxMap <- foldM addSyntaxMap defaultSyntaxMap (optSyntaxDefinitions opts) - unless (null (optSyntaxDefinitions opts)) $ - case missingIncludes (M.elems syntaxMap) of - [] -> return () - xs -> E.throwIO $ PandocSyntaxMapError $ - "Missing syntax definitions:\n" ++ - unlines (map - (\(syn,dep) -> (T.unpack syn ++ " requires " ++ - T.unpack dep ++ " through IncludeRules.")) xs) - -- We don't want to send output to the terminal if the user -- does 'pandoc -t docx input.txt'; though we allow them to -- force this with '-o -'. On posix systems, we detect -- cgit v1.2.3