diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-11-05 20:21:38 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-11-05 20:24:29 +0100 |
commit | 7db4dd46dc2fba2cb3ec2a6c3191c3147b2b215f (patch) | |
tree | 5666abd3aba813ed4cc3518d0b72a096809078f3 | |
parent | e6422b1debeced6e6d96b6e7bef796460891ef70 (diff) | |
download | pandoc-7db4dd46dc2fba2cb3ec2a6c3191c3147b2b215f.tar.gz |
Allow `file://` URIs as arguments.
Also improved default reader format detection. Previously
with a URI ending in .md or .markdown, pandoc would assume HTML input.
Now it treats these as markdown.
Closes #3196.
-rw-r--r-- | pandoc.hs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1019,6 +1019,8 @@ defaultReaderName fallback (x:xs) = ".xhtml" -> "html" ".html" -> "html" ".htm" -> "html" + ".md" -> "markdown" + ".markdown" -> "markdown" ".tex" -> "latex" ".latex" -> "latex" ".ltx" -> "latex" @@ -1375,6 +1377,8 @@ convertWithOpts opts args = do readSource src = case parseURI src of Just u | uriScheme u `elem` ["http:","https:"] -> readURI src + | uriScheme u == "file:" -> + UTF8.readFile (uriPath u) _ -> UTF8.readFile src readURI src = do res <- openURL src |