git.iko.soy/typeable/pandoc
on master help sign in
Fix regression finding templates in user data directory.

Under version 2.2.1 and prior pandoc found latex templates in the templates directory under the data directory, but this no longer works in 2.2.2. MANUAL says: "If the template is not found, pandoc will search for it in the templates subdirectory of the user data directory (see `--data-dir`)." This commit fixes the regression, which stems from 07bce91. Closes #4777.

commitd7edfbdf4d0680dcbc6cb1e7ed01e64c13db0871 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 18 Jul 2018, 18:53 (8 years ago) parente1eeb66
1 file changed+1−3
src/Text/Pandoc/App.hs+1−3
src/Text/Pandoc/App.hs+1−3
@@ -83,7 +83,6 @@ import System.Exit (exitSuccess)
8383import System.FilePath
8484import System.IO (nativeNewline, stdout)
8585import qualified System.IO as IO (Newline (..))
86−import System.IO.Error (isDoesNotExistError)
8786import Text.Pandoc
8887import Text.Pandoc.BCP47 (Lang (..), parseBCP47)
8988import Text.Pandoc.Builder (setMeta, deleteMeta)
@@ -383,8 +382,7 @@ convertWithOpts opts = do
383382 ((fst <$> fetchItem tp') `catchError`
384383 (\e ->
385384 case e of
386− PandocIOError _ e' |
387− isDoesNotExistError e' ->
385+ PandocResourceNotFound _ ->
388386 readDataFile ("templates" </> tp')
389387 _ -> throwError e))
390388