From 92ccb88cb73cb2e904e085bc223ba0bb777aa18d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 13 Jun 2019 09:40:46 -0700 Subject: [PATCH] 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. --- src/Text/Pandoc/App/OutputSettings.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 _ ->