aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.cabal1
-rw-r--r--src/Text/Pandoc/Lua/Packages.hs4
-rw-r--r--stack.yaml1
3 files changed, 6 insertions, 0 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index 1d9ca19dd..8911cdb1b 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -561,6 +561,7 @@ library
http-types >= 0.8 && < 0.13,
ipynb >= 0.1.0.2 && < 0.2,
jira-wiki-markup >= 1.4 && < 1.5,
+ lpeg >= 1.0 && < 1.1,
mtl >= 2.2 && < 2.3,
network >= 2.6,
network-uri >= 2.6 && < 2.8,
diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs
index 3a481886a..4fb11a646 100644
--- a/src/Text/Pandoc/Lua/Packages.hs
+++ b/src/Text/Pandoc/Lua/Packages.hs
@@ -22,6 +22,7 @@ import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, loadDefaultModule)
import qualified HsLua as Lua
import qualified HsLua.Module.Path as Path
import qualified HsLua.Module.Text as Text
+import qualified Lua.LPeg as LPeg
import qualified Text.Pandoc.Lua.Module.Pandoc as Pandoc
import qualified Text.Pandoc.Lua.Module.MediaBag as MediaBag
import qualified Text.Pandoc.Lua.Module.System as System
@@ -35,6 +36,9 @@ installPandocPackageSearcher = liftPandocLua $ do
shiftArray
Lua.pushHaskellFunction $ Lua.toHaskellFunction pandocPackageSearcher
Lua.rawseti (Lua.nth 2) 1
+ -- add lpeg searcher as last searcher
+ Lua.pushHaskellFunction $ Lua.state >>= Lua.liftIO . LPeg.lpeg_searcher
+ Lua.rawseti (Lua.nth 2) 6
Lua.pop 1 -- remove 'package.searchers' from stack
where
shiftArray = forM_ [4, 3, 2, 1] $ \i -> do
diff --git a/stack.yaml b/stack.yaml
index 651c25167..656063846 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -12,6 +12,7 @@ extra-deps:
- doctemplates-0.10
- emojis-0.1.2
- doclayout-0.3.1.1
+- lpeg-1.0.0
- hslua-2.0.1
- hslua-classes-2.0.0
- hslua-core-2.0.0.2