aboutsummaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/pandoc.hs b/pandoc.hs
index a83426bff..2353ebb11 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -30,7 +30,6 @@ Parses command-line options and calls the appropriate readers and
writers.
-}
module Main where
-import Prelude
import Text.Pandoc
import Text.Pandoc.Builder (setMeta)
import Text.Pandoc.PDF (makePDF)
@@ -1011,6 +1010,7 @@ defaultWriterName x =
".epub" -> "epub"
".org" -> "org"
".asciidoc" -> "asciidoc"
+ ".adoc" -> "asciidoc"
".pdf" -> "latex"
".fb2" -> "fb2"
".opml" -> "opml"
@@ -1140,7 +1140,7 @@ main = do
-- --bibliography implies -F pandoc-citeproc for backwards compatibility:
- let needsCiteproc = any ("--bibliography" `isPrefixOf`) rawArgs &&
+ let needsCiteproc = M.lookup "bibliography" (optMetadata opts) /= Nothing &&
optCiteMethod opts `notElem` [Natbib, Biblatex] &&
"pandoc-citeproc" `notElem` map takeBaseName filters
let filters' = if needsCiteproc then "pandoc-citeproc" : filters
@@ -1176,6 +1176,9 @@ main = do
"beamer" `isPrefixOf` writerName'
let conTeXtOutput = "context" `isPrefixOf` writerName'
+ let laTeXInput = "latex" `isPrefixOf` readerName' ||
+ "beamer" `isPrefixOf` readerName'
+
writer <- if ".lua" `isSuffixOf` writerName'
-- note: use non-lowercased version writerName
then return $ IOStringWriter $ writeCustom writerName
@@ -1257,8 +1260,10 @@ main = do
uriFragment = "" }
_ -> Nothing
- let readerOpts = def{ readerSmart = smart || (texLigatures &&
- (laTeXOutput || conTeXtOutput))
+ let readerOpts = def{ readerSmart = if laTeXInput
+ then texLigatures
+ else smart || (texLigatures &&
+ (laTeXOutput || conTeXtOutput))
, readerStandalone = standalone'
, readerParseRaw = parseRaw
, readerColumns = columns