aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App/OutputSettings.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-06-13 09:40:46 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-06-13 09:40:46 -0700
commit92ccb88cb73cb2e904e085bc223ba0bb777aa18d (patch)
treeb536366c2cf0710c721c71159243f1311623ab16 /src/Text/Pandoc/App/OutputSettings.hs
parentfa50da30306aafed815a47ae4fc0f2f663bdd54d (diff)
downloadpandoc-92ccb88cb73cb2e904e085bc223ba0bb777aa18d.tar.gz
Don't look for template files remotely for remote input.
Previously pandoc would look for the template at a remote URL when a URL was used for the input file, instead of taking it from the data-dir. Closes #5579.
Diffstat (limited to 'src/Text/Pandoc/App/OutputSettings.hs')
-rw-r--r--src/Text/Pandoc/App/OutputSettings.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs
index 343287a4b..837636503 100644
--- a/src/Text/Pandoc/App/OutputSettings.hs
+++ b/src/Text/Pandoc/App/OutputSettings.hs
@@ -165,7 +165,16 @@ optToOutputSettings opts = do
"" -> tp <.> format
_ -> tp
Just . UTF8.toString <$>
- ((fst <$> fetchItem tp') `catchError`
+ ((do surl <- stSourceURL <$> getCommonState
+ -- we don't want to look for templates remotely
+ -- unless the full URL is specified:
+ modifyCommonState $ \st -> st{
+ stSourceURL = Nothing }
+ (bs, _) <- fetchItem tp'
+ modifyCommonState $ \st -> st{
+ stSourceURL = surl }
+ return bs)
+ `catchError`
(\e ->
case e of
PandocResourceNotFound _ ->