diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2021-11-06 16:45:03 -0700 | 
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2021-11-06 16:47:13 -0700 | 
| commit | 213913f02554b5cec8ea946538d8ba445d4d3f4e (patch) | |
| tree | 290ad10e1fffb9620434c0cf5c74ac6b3ad7b436 /src/Text/Pandoc | |
| parent | 822f8949841f851a56bbd964433aa60205609d20 (diff) | |
| download | pandoc-213913f02554b5cec8ea946538d8ba445d4d3f4e.tar.gz | |
Pass ReaderOptions to custom readers as second parameter.
Diffstat (limited to 'src/Text/Pandoc')
| -rw-r--r-- | src/Text/Pandoc/Readers/Custom.hs | 7 | 
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Custom.hs b/src/Text/Pandoc/Readers/Custom.hs index 83d82a9cc..d7336012b 100644 --- a/src/Text/Pandoc/Readers/Custom.hs +++ b/src/Text/Pandoc/Readers/Custom.hs @@ -33,9 +33,7 @@ readCustom :: (PandocMonad m, MonadIO m, ToSources s)              => FilePath -> ReaderOptions -> s -> m Pandoc  readCustom luaFile opts sources = do    let input = sourcesToText $ toSources sources -  let globals = [ PANDOC_SCRIPT_FILE luaFile -                , PANDOC_READER_OPTIONS opts -                ] +  let globals = [ PANDOC_SCRIPT_FILE luaFile ]    res <- runLua $ do      setGlobals globals      stat <- dofileWithTraceback luaFile @@ -43,13 +41,14 @@ readCustom luaFile opts sources = do      -- to handle this more gracefully):      when (stat /= Lua.OK)        Lua.throwErrorAsException -    parseCustom input +    parseCustom input opts    case res of      Left msg -> throw msg      Right doc -> return doc  parseCustom :: forall e. PeekError e              => Text +            -> ReaderOptions              -> LuaE e Pandoc  parseCustom = invoke @e "Reader"  | 
