mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-24 17:26:32 +00:00
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.
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user