git.iko.soy/typeable/pandoc
on master help sign in
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.

commit7db4dd46dc2fba2cb3ec2a6c3191c3147b2b215f authorJohn MacFarlane <jgm@berkeley.edu> dateSat 5 Nov 2016, 20:21 (10 years ago) parente6422b1
1 file changed+4
pandoc.hs+4
pandoc.hs+4
@@ -1019,6 +1019,8 @@ defaultReaderName fallback (x:xs) =
10191019 ".xhtml" -> "html"
10201020 ".html" -> "html"
10211021 ".htm" -> "html"
1022+ ".md" -> "markdown"
1023+ ".markdown" -> "markdown"
10221024 ".tex" -> "latex"
10231025 ".latex" -> "latex"
10241026 ".ltx" -> "latex"
@@ -1375,6 +1377,8 @@ convertWithOpts opts args = do
13751377 readSource src = case parseURI src of
13761378 Just u | uriScheme u `elem` ["http:","https:"] ->
13771379 readURI src
1380+ | uriScheme u == "file:" ->
1381+ UTF8.readFile (uriPath u)
13781382 _ -> UTF8.readFile src
13791383 readURI src = do
13801384 res <- openURL src