git.iko.soy/typeable/pandoc
on master help sign in
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.

commitae6ba1533bbe79bc82d2b3fc47dc3cde55bf7370 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 7 Jan 2018, 18:41 (9 years ago) parentb6cec3d
4 files changed+5−14
pandoc.cabal+1−1 src/Text/Pandoc/App.hs+1−11 stack.lts9.yaml+1−1 stack.yaml+2−1
pandoc.cabal+1−1
@@ -365,7 +365,7 @@ library
365365 tagsoup >= 0.14.2 && < 0.15,
366366 base64-bytestring >= 0.1 && < 1.1,
367367 zlib >= 0.5 && < 0.7,
368− skylighting >= 0.5 && < 0.6,
368+ skylighting >= 0.5.1 && < 0.6,
369369 data-default >= 0.4 && < 0.8,
370370 temporary >= 1.1 && < 1.3,
371371 blaze-html >= 0.5 && < 0.10,
src/Text/Pandoc/App.hs+1−11
@@ -71,8 +71,7 @@ import Data.Aeson.Encode.Pretty (encodePretty', Config(..), keyOrder,
7171 defConfig, Indent(..), NumberFormat(..))
7272import Skylighting (Style, Syntax (..), defaultSyntaxMap, parseTheme,
7373 pygments)
74−import Skylighting.Parser (addSyntaxDefinition, missingIncludes,
75− parseSyntaxDefinition)
74+import Skylighting.Parser (addSyntaxDefinition, parseSyntaxDefinition)
7675import System.Console.GetOpt
7776import System.Directory (Permissions (..), doesFileExist, findExecutable,
7877 getAppUserDataDirectory, getPermissions)
@@ -268,15 +267,6 @@ convertWithOpts opts = do
268267 syntaxMap <- foldM addSyntaxMap defaultSyntaxMap
269268 (optSyntaxDefinitions opts)
270269
271− unless (null (optSyntaxDefinitions opts)) $
272− case missingIncludes (M.elems syntaxMap) of
273− [] -> return ()
274− xs -> E.throwIO $ PandocSyntaxMapError $
275− "Missing syntax definitions:\n" ++
276− unlines (map
277− (\(syn,dep) -> (T.unpack syn ++ " requires " ++
278− T.unpack dep ++ " through IncludeRules.")) xs)
279−
280270 -- We don't want to send output to the terminal if the user
281271 -- does 'pandoc -t docx input.txt'; though we allow them to
282272 -- force this with '-o -'. On posix systems, we detect
stack.lts9.yaml+1−1
@@ -16,7 +16,7 @@ extra-deps:
1616- pandoc-types-1.17.3
1717- hslua-0.9.5
1818- hslua-module-text-0.1.2
19−- skylighting-0.5
19+- skylighting-0.5.1
2020- texmath-0.10.1
2121- cmark-gfm-0.1.1
2222- QuickCheck-2.10.0.1
stack.yaml+2−1
@@ -15,4 +15,5 @@ packages:
1515extra-deps:
1616- pandoc-citeproc-0.12.2.5
1717- hslua-0.9.5
18−resolver: lts-10.1
18+- skylighting-0.5.1
19+resolver: lts-10.2