diff options
| author | John MacFarlane <[email protected]> | 2023-07-19 15:09:12 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-07-19 15:09:12 -0700 |
| commit | eb090c50ff6dc35e3a2971d831a9832c69db7d8d (patch) | |
| tree | 49d0e44d21ffa1ff4d41c5e18ce5ef175e326a4f /src | |
| parent | b411aa4085be6883c588145f1527663007de73cc (diff) | |
Fix errors for illegal output formats.
Previously if you did `pandoc -s -t bbb`, it would give you
an error about the missing bbb template instead of saying that
it's not a supported output format.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/App/OutputSettings.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs index d87c36a36..17a603b07 100644 --- a/src/Text/Pandoc/App/OutputSettings.hs +++ b/src/Text/Pandoc/App/OutputSettings.hs @@ -143,15 +143,17 @@ optToOutputSettings scriptingEngine opts = do Just t -> (runWithDefaultPartials $ compileTemplate path t) >>= templateOrThrow return (w, wexts, templ) - else do - tmpl <- processCustomTemplate (compileDefaultTemplate format) + else if optSandbox opts - then case runPure (getWriter flvrd) of + then do + tmpl <- processCustomTemplate (compileDefaultTemplate format) + case runPure (getWriter flvrd) of Right (w, wexts) -> return (makeSandboxed w, wexts, tmpl) Left e -> throwError e else do - (w, wexts) <- getWriter flvrd - return (w, wexts, tmpl) + (w, wexts) <- getWriter flvrd + tmpl <- processCustomTemplate (compileDefaultTemplate format) + return (w, wexts, tmpl) let addSyntaxMap existingmap f = do |
