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.
This commit is contained in:
John MacFarlane 2019-06-13 09:40:46 -07:00
parent fa50da3030
commit 92ccb88cb7

View file

@ -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 _ ->