summaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-03-21 16:56:42 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2016-03-21 17:02:07 -0400
commita8a2d4f2241118152f245d5dc67a6452606cad71 (patch)
treed708f5c9895eb1d180bb9b07e2f5a7e71e342436 /pandoc.hs
parent08c625cff070971feb5f4ee7a3972aca6b27cd4b (diff)
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`.
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs1
1 files changed, 1 insertions, 0 deletions
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)