aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/Global.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-11-06 11:00:26 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2021-11-06 09:04:29 -0700
commit6b462e59332242c18ea38a721ae672b88f33d621 (patch)
treec33d9d0fe2835cfbaddb7d84b58e2ae5736d9381 /src/Text/Pandoc/Lua/Global.hs
parentee2f0021f9b59f0bca6eabf4884641da7a09e21d (diff)
downloadpandoc-6b462e59332242c18ea38a721ae672b88f33d621.tar.gz
Lua: allow to pass custom reader options to `pandoc.read`
Reader options can now be passed as an optional third argument to `pandoc.read`. The object can either be a table or a ReaderOptions value like `PANDOC_READER_OPTIONS`. Creating new ReaderOptions objects is possible through the new constructor `pandoc.ReaderOptions`. Closes: #7656
Diffstat (limited to 'src/Text/Pandoc/Lua/Global.hs')
-rw-r--r--src/Text/Pandoc/Lua/Global.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/Global.hs b/src/Text/Pandoc/Lua/Global.hs
index 23b3a8284..05510f45d 100644
--- a/src/Text/Pandoc/Lua/Global.hs
+++ b/src/Text/Pandoc/Lua/Global.hs
@@ -22,7 +22,7 @@ import Text.Pandoc.Definition (Pandoc (Pandoc), pandocTypesVersion)
import Text.Pandoc.Error (PandocError)
import Text.Pandoc.Lua.Marshaling ()
import Text.Pandoc.Lua.Marshaling.CommonState (pushCommonState)
-import Text.Pandoc.Lua.Marshaling.ReaderOptions (pushReaderOptions)
+import Text.Pandoc.Lua.Marshaling.ReaderOptions (pushReaderOptionsReadonly)
import Text.Pandoc.Options (ReaderOptions)
import qualified Data.Text as Text
@@ -55,7 +55,7 @@ setGlobal global = case global of
pushUD typePandocLazy doc
Lua.setglobal "PANDOC_DOCUMENT"
PANDOC_READER_OPTIONS ropts -> do
- pushReaderOptions ropts
+ pushReaderOptionsReadonly ropts
Lua.setglobal "PANDOC_READER_OPTIONS"
PANDOC_SCRIPT_FILE filePath -> do
Lua.push filePath