aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-01-07 18:41:01 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-01-07 19:24:08 -0800
commitae6ba1533bbe79bc82d2b3fc47dc3cde55bf7370 (patch)
tree2ec130eb434ab4da17f656067247406b766fbc76 /src
parentb6cec3da3fc598df8ee1e317e405a61fa145dfd8 (diff)
downloadpandoc-ae6ba1533bbe79bc82d2b3fc47dc3cde55bf7370.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/App.hs12
1 files changed, 1 insertions, 11 deletions
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