diff options
| author | John MacFarlane <[email protected]> | 2022-01-03 10:16:07 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-01-03 10:16:07 -0800 |
| commit | 75c5218d4ffcd7aabbb8bc62d5e1b4d12332b8aa (patch) | |
| tree | 6554afd1ec742376faaa60c6f6c52fab0694c40c /src | |
| parent | 811eee7cad840a65dbdcd72649b4007a9e8e46e2 (diff) | |
Don't read sources until in/out format are verified.
Partially addresses #7797.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/App.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 59fd43bac..3ddc4c761 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -116,8 +116,6 @@ convertWithOpts opts = do setInputFiles (fromMaybe ["-"] (optInputFiles opts)) setOutputFile (optOutputFile opts) - inputs <- readSources sources - -- assign reader and writer based on options and filenames readerName <- case optFrom opts of Just f -> return f @@ -282,6 +280,9 @@ convertWithOpts opts = do (optCitationAbbreviations opts) $ mempty let filterEnv = Environment readerOpts writerOptions + + inputs <- readSources sources + doc <- (case reader of TextReader r | readerNameBase == "json" -> |
