git.iko.soy/typeable/pandoc
on master help sign in
Set `--standalone` implicitly when non-text output format.
db1c16eJohn MacFarlane
src/pandoc.hs+4−4
@@ -743,7 +743,7 @@ main = do
743 then "html"
743 then "html"
744 else "markdown"
744 else "markdown"
745 in defaultReaderName fallback sources
745 in defaultReaderName fallback sources
746− else readerName
746+ else readerName
747
747
748 let writerName' = if null writerName
748 let writerName' = if null writerName
749 then defaultWriterName outputFile
749 then defaultWriterName outputFile
@@ -753,8 +753,10 @@ main = do
753 Just r -> return r
753 Just r -> return r
754 Nothing -> error ("Unknown reader: " ++ readerName')
754 Nothing -> error ("Unknown reader: " ++ readerName')
755
755
756+ let standalone' = standalone || isNonTextOutput writerName'
757+
756 templ <- case templatePath of
758 templ <- case templatePath of
757− _ | not standalone -> return ""
759+ _ | not standalone' -> return ""
758 Nothing -> do
760 Nothing -> do
759 deftemp <- getDefaultTemplate datadir writerName'
761 deftemp <- getDefaultTemplate datadir writerName'
760 case deftemp of
762 case deftemp of
@@ -774,8 +776,6 @@ main = do
774 (\_ -> throwIO e)
776 (\_ -> throwIO e)
775 else throwIO e)
777 else throwIO e)
776
778
777− let standalone' = standalone || isNonTextOutput writerName'
778−
779 variables' <- case mathMethod of
779 variables' <- case mathMethod of
780 LaTeXMathML Nothing -> do
780 LaTeXMathML Nothing -> do
781 s <- readDataFile datadir $ "data" </> "LaTeXMathML.js"
781 s <- readDataFile datadir $ "data" </> "LaTeXMathML.js"