summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-05-21 08:59:06 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-05-21 09:02:01 +0200
commit8c1b81bbef7125a9a2fde9d6894578f06bf4cedd (patch)
tree869b778f2f0b840b71a1056f427cd6690d2fc6d4 /src/Text/Pandoc
parent6a7f980247bd2e3fcb7b977edbbcd1fc17758074 (diff)
Finished implemtation of `--resource-path`.
* Default is just working directory. * Working directory must be explicitly specifide if `--resource-path` option is used.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/App.hs4
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index a4967e5d1..c874a2cde 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -414,7 +414,7 @@ convertWithOpts opts = do
let eol = fromMaybe nativeNewline $ optEol opts
runIO' $ do
- setResourcePath $ "." : (optResourcePath opts)
+ setResourcePath (optResourcePath opts)
(doc, media) <- withMediaBag $ sourceToDoc sources >>=
( (if isJust (optExtractMedia opts)
then fillMediaBag (writerSourceURL writerOptions)
@@ -640,7 +640,7 @@ defaultOpts = Opt
, optIncludeBeforeBody = []
, optIncludeAfterBody = []
, optIncludeInHeader = []
- , optResourcePath = []
+ , optResourcePath = ["."]
, optEol = Nothing
}
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 30c788666..84758d309 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -46,7 +46,7 @@ import Safe (minimumDef)
import System.FilePath (addExtension, replaceExtension, takeExtension)
import Text.Pandoc.Builder
import Text.Pandoc.Class (PandocMonad, PandocPure, lookupEnv, readFileFromDirs,
- report, setResourcePath)
+ report, setResourcePath, getResourcePath)
import Text.Pandoc.Highlighting (fromListingsLanguage, languagesByExtension)
import Text.Pandoc.ImageSize (numUnit, showFl)
import Text.Pandoc.Logging
@@ -417,7 +417,7 @@ blockCommands = M.fromList $
graphicsPath :: PandocMonad m => LP m Blocks
graphicsPath = do
ps <- bgroup *> (manyTill braced egroup)
- setResourcePath (".":ps)
+ getResourcePath >>= setResourcePath . (++ ps)
return mempty
addMeta :: PandocMonad m => ToMetaValue a => String -> a -> LP m ()