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:
parent
e6422b1deb
commit
7db4dd46dc
1 changed files with 4 additions and 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
|
||||
|
|
Loading…
Add table
Reference in a new issue