Fixed duplicate text bug in markdown2pdf.hs. (Paulo Tanimoto)

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1582 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2009-06-25 01:12:07 +00:00
parent 541a032e49
commit 15258f66f0
2 changed files with 10 additions and 9 deletions

View file

@ -238,9 +238,8 @@ Executable markdown2pdf
Ghc-Options: -Wall -threaded Ghc-Options: -Wall -threaded
Ghc-Prof-Options: -auto-all Ghc-Prof-Options: -auto-all
Extensions: CPP, TemplateHaskell Extensions: CPP, TemplateHaskell
Buildable: False if flag(wrappers)
-- if flag(wrappers) Buildable: True
-- Buildable: True else
-- else Buildable: False
-- Buildable: False

View file

@ -171,17 +171,19 @@ main = bracket
filter (\l -> any (`isInfixOf` l) goodoptsLong) $ lines out filter (\l -> any (`isInfixOf` l) goodoptsLong) $ lines out
exitWith code exitWith code
-- parse arguments -- parse arguments
-- if no input given, use 'stdin'
pandocArgs <- parsePandocArgs args pandocArgs <- parsePandocArgs args
(inputs, output) <- case pandocArgs of (input, output) <- case pandocArgs of
Nothing -> exit "Could not parse arguments" Nothing -> exit "Could not parse arguments"
Just ([],out) -> do Just ([],out) -> do
stdinFile <- saveStdin (replaceDirectory (takeBaseName out) tmp) stdinFile <- saveStdin (replaceDirectory (takeBaseName out) tmp)
case stdinFile of case stdinFile of
Left err -> exit err Left err -> exit err
Right f -> return ([f], out) Right f -> return ([f], out)
Just (fs,out) -> return (fs, out) -- no need because we'll pass all arguments to pandoc
Just (_ ,out) -> return ([], out)
-- run pandoc -- run pandoc
pandocRes <- runPandoc (args ++ inputs) $ replaceDirectory output tmp pandocRes <- runPandoc (input ++ args) $ replaceDirectory output tmp
case pandocRes of case pandocRes of
Left err -> exit err Left err -> exit err
Right texFile -> do Right texFile -> do