aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/PandocModule.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Lua/PandocModule.hs')
-rw-r--r--src/Text/Pandoc/Lua/PandocModule.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Lua/PandocModule.hs b/src/Text/Pandoc/Lua/PandocModule.hs
index bf45cab17..a110905e5 100644
--- a/src/Text/Pandoc/Lua/PandocModule.hs
+++ b/src/Text/Pandoc/Lua/PandocModule.hs
@@ -38,6 +38,7 @@ import Control.Monad (unless, zipWithM_)
import Data.ByteString.Char8 (unpack)
import Data.Default (Default (..))
import Data.IORef
+import Data.Maybe (fromMaybe)
import Data.Text (pack)
import Foreign.Lua (Lua, FromLuaStack, ToLuaStack, NumResults, liftIO)
import Text.Pandoc.Class (fetchMediaResource, readDataFile, runIO,
@@ -146,6 +147,9 @@ insertResource commonState mbRef src = do
fetchMediaResource src
liftIO $ print (fp, mimeType) -- TODO DEBUG
insertMediaFn mbRef fp (OrNil mimeType) bs
+ Lua.push fp
+ Lua.push $ fromMaybe "" mimeType
+ return 2 -- returns 2 values: name in mediabag, mimetype
--
-- Helper types and orphan instances