mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-24 09:16:43 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user