From db1c16e8562a7611e0defbacc353a77fbf1727d2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 22 Nov 2011 14:21:19 -0800 Subject: 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. --- src/pandoc.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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" -- cgit v1.2.3