From d7edfbdf4d0680dcbc6cb1e7ed01e64c13db0871 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 18 Jul 2018 18:53:55 -0700 Subject: 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. --- src/Text/Pandoc/App.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index b79273092..f4b7f1904 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -83,7 +83,6 @@ import System.Exit (exitSuccess) import System.FilePath import System.IO (nativeNewline, stdout) import qualified System.IO as IO (Newline (..)) -import System.IO.Error (isDoesNotExistError) import Text.Pandoc import Text.Pandoc.BCP47 (Lang (..), parseBCP47) import Text.Pandoc.Builder (setMeta, deleteMeta) @@ -383,8 +382,7 @@ convertWithOpts opts = do ((fst <$> fetchItem tp') `catchError` (\e -> case e of - PandocIOError _ e' | - isDoesNotExistError e' -> + PandocResourceNotFound _ -> readDataFile ("templates" tp') _ -> throwError e)) -- cgit v1.2.3