git.iko.soy/typeable/pandoc
on master help sign in
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.

commit92ccb88cb73cb2e904e085bc223ba0bb777aa18d authorJohn MacFarlane <jgm@berkeley.edu> dateThu 13 Jun 2019, 09:40 (7 years ago) parentfa50da3
1 file changed+10−1
src/Text/Pandoc/App/OutputSettings.hs+10−1
src/Text/Pandoc/App/OutputSettings.hs+10−1
@@ -165,7 +165,16 @@ optToOutputSettings opts = do
165165 "" -> tp <.> format
166166 _ -> tp
167167 Just . UTF8.toString <$>
168− ((fst <$> fetchItem tp') `catchError`
168+ ((do surl <- stSourceURL <$> getCommonState
169+ -- we don't want to look for templates remotely
170+ -- unless the full URL is specified:
171+ modifyCommonState $ \st -> st{
172+ stSourceURL = Nothing }
173+ (bs, _) <- fetchItem tp'
174+ modifyCommonState $ \st -> st{
175+ stSourceURL = surl }
176+ return bs)
177+ `catchError`
169178 (\e ->
170179 case e of
171180 PandocResourceNotFound _ ->