aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:15:50 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:15:50 +0000
commitfbef848a3af236ca3a18e6aad7c459e93b8495fc (patch)
tree7c0da5f5d01a4457f3efb78c6384ee190ea9ae44 /src
parent7baa79597e1306eeed0313ffafd240b4df5080bb (diff)
downloadpandoc-fbef848a3af236ca3a18e6aad7c459e93b8495fc.tar.gz
Use $for$ for header-includes.
Put variables in right order. We've specified that if they use -A, -B, -H multiple times, the text appears in the same order as on the command line. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1722 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r--src/pandoc.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index 8b626c2c2..7ddb41b00 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -347,7 +347,7 @@ options =
(\arg opt ->
case break (`elem` ":=") arg of
(k,_:v) -> do
- let newvars = (k, v) : optVariables opt
+ let newvars = optVariables opt ++ [(k,v)]
return opt{ optVariables = newvars }
_ -> do
hPutStrLn stderr $ "Could not parse `" ++ arg ++ "' as a key/value pair (k=v or k:v)"
@@ -358,7 +358,8 @@ options =
, Option "c" ["css"]
(ReqArg
(\arg opt -> do
- let newvars = ("css",arg) : optVariables opt
+ -- add new link to end, so it is included in proper order
+ let newvars = optVariables opt ++ [("css",arg)]
return opt { optVariables = newvars,
optStandalone = True })
"URL")
@@ -368,7 +369,8 @@ options =
(ReqArg
(\arg opt -> do
text <- readFile arg
- let newvars = ("header-includes",text) : optVariables opt
+ -- add new ones to end, so they're included in order specified
+ let newvars = optVariables opt ++ [("header-includes",text)]
return opt { optVariables = newvars,
optStandalone = True })
"FILENAME")
@@ -379,7 +381,8 @@ options =
(\arg opt -> do
text <- readFile arg
let oldBefore = optBefore opt
- return opt { optBefore = text : oldBefore })
+ -- add new text to end, so it is included in proper order
+ return opt { optBefore = oldBefore ++ [text] })
"FILENAME")
"" -- "File to include before document body"
@@ -388,7 +391,8 @@ options =
(\arg opt -> do
text <- readFile arg
let oldAfter = optAfter opt
- return opt { optAfter = text : oldAfter })
+ -- add new text to end, so it is included in proper order
+ return opt { optAfter = oldAfter ++ [text]})
"FILENAME")
"" -- "File to include after document body"
@@ -625,11 +629,7 @@ main = do
variables' <- if writerName' == "s5" && standalone'
then do
inc <- s5HeaderIncludes
- return $ case lookup "header-includes" variables of
- Nothing -> ("header-includes", inc) : variables
- Just a -> ("header-includes", a ++ inc) :
- filter ((/= "header-includes") . fst)
- variables
+ return $ ("header-includes", inc) : variables
else return variables
variables'' <- case mathMethod of