From a8a2d4f2241118152f245d5dc67a6452606cad71 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Mon, 21 Mar 2016 16:56:42 -0400 Subject: [PATCH] Fix stdin handling for file-scope Regardless of input type, we should use default handling if we are dealing with stdin. In other words, there should be no file-scope if there are no files. This was an issue with pandoc json, which could be piped on stdin, but which was read by default with `--file-scope`. --- pandoc.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/pandoc.hs b/pandoc.hs index 39335785c..934a34493 100644 --- a/pandoc.hs +++ b/pandoc.hs @@ -1327,6 +1327,7 @@ convertWithOpts opts args = do (doc, media) <- case reader of (StringReader _) | not fileScope && readerName' /= "json" -> sourceToDoc sources + _ | null sources -> sourceToDoc sources _ -> do pairs <- mapM (\s -> sourceToDoc [s]) sources return (mconcat $ map fst pairs, mconcat $ map snd pairs)