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.
This commit is contained in:
John MacFarlane
2018-01-07 19:24:08 -08:00
parent b6cec3da3f
commit ae6ba1533b
4 changed files with 5 additions and 14 deletions
+1 -1
View File
@@ -365,7 +365,7 @@ library
tagsoup >= 0.14.2 && < 0.15,
base64-bytestring >= 0.1 && < 1.1,
zlib >= 0.5 && < 0.7,
skylighting >= 0.5 && < 0.6,
skylighting >= 0.5.1 && < 0.6,
data-default >= 0.4 && < 0.8,
temporary >= 1.1 && < 1.3,
blaze-html >= 0.5 && < 0.10,
+1 -11
View File
@@ -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
+1 -1
View File
@@ -16,7 +16,7 @@ extra-deps:
- pandoc-types-1.17.3
- hslua-0.9.5
- hslua-module-text-0.1.2
- skylighting-0.5
- skylighting-0.5.1
- texmath-0.10.1
- cmark-gfm-0.1.1
- QuickCheck-2.10.0.1
+2 -1
View File
@@ -15,4 +15,5 @@ packages:
extra-deps:
- pandoc-citeproc-0.12.2.5
- hslua-0.9.5
resolver: lts-10.1
- skylighting-0.5.1
resolver: lts-10.2