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`.
This commit is contained in:
Jesse Rosenthal 2016-03-21 16:56:42 -04:00
parent 08c625cff0
commit a8a2d4f224

View file

@ -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)