summaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-11-22 14:21:19 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-11-22 14:22:22 -0800
commitdb1c16e8562a7611e0defbacc353a77fbf1727d2 (patch)
tree25d7bdd04af09a32d9bb11545f13b4f2e4a8a197 /src/pandoc.hs
parent2f3d76844af26b21b662481917297f7d0732a685 (diff)
Set `--standalone` implicitly when non-text output format.
(ODT, EPUB). This restores pandoc's previous behavior. You can again do `pandoc test.txt -o test.odt` and get a standalone ODT file. Resolves #351.
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index b2af46e14..d6cf1da85 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -743,7 +743,7 @@ main = do
then "html"
else "markdown"
in defaultReaderName fallback sources
- else readerName
+ else readerName
let writerName' = if null writerName
then defaultWriterName outputFile
@@ -753,8 +753,10 @@ main = do
Just r -> return r
Nothing -> error ("Unknown reader: " ++ readerName')
+ let standalone' = standalone || isNonTextOutput writerName'
+
templ <- case templatePath of
- _ | not standalone -> return ""
+ _ | not standalone' -> return ""
Nothing -> do
deftemp <- getDefaultTemplate datadir writerName'
case deftemp of
@@ -774,8 +776,6 @@ main = do
(\_ -> throwIO e)
else throwIO e)
- let standalone' = standalone || isNonTextOutput writerName'
-
variables' <- case mathMethod of
LaTeXMathML Nothing -> do
s <- readDataFile datadir $ "data" </> "LaTeXMathML.js"