diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-06-13 09:40:46 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-06-13 09:40:46 -0700 |
commit | 92ccb88cb73cb2e904e085bc223ba0bb777aa18d (patch) | |
tree | b536366c2cf0710c721c71159243f1311623ab16 /src/Text | |
parent | fa50da30306aafed815a47ae4fc0f2f663bdd54d (diff) | |
download | pandoc-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')
-rw-r--r-- | src/Text/Pandoc/App/OutputSettings.hs | 11 |
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 _ -> |