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`.
commita8a2d4f2241118152f245d5dc67a6452606cad71
authorJesse Rosenthal <jrosenthal@jhu.edu>
dateMon 21 Mar 2016, 16:56 (11 years ago)
parent08c625c
pandoc.hs+1
@@ -1327,6 +1327,7 @@ convertWithOpts opts args = do
13271327 (doc, media) <- case reader of
13281328 (StringReader _) | not fileScope && readerName' /= "json" ->
13291329 sourceToDoc sources
1330+ _ | null sources -> sourceToDoc sources
13301331 _ -> do pairs <- mapM (\s -> sourceToDoc [s]) sources
13311332 return (mconcat $ map fst pairs, mconcat $ map snd pairs)
13321333