diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-05-03 18:34:23 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-05-03 18:34:23 -0700 |
commit | 2ba78730861b0947ed26aec00f0520e5affd5f7c (patch) | |
tree | 7c007a033de29f4ad050ca3d9e72a1c3bd8ed94f /src/Text/Pandoc | |
parent | 743dac493fab08abdec59feb7bd57030a3ba5c90 (diff) | |
download | pandoc-2ba78730861b0947ed26aec00f0520e5affd5f7c.tar.gz |
LaTeX reader: Fixed regression introduced with last commit.
Tests now pass again.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index d1e0b6f0a..79c66b510 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -852,18 +852,18 @@ braced' = try $ char '{' *> manyTill (satisfy (/='}')) (char '}') include' :: IncludeParser include' = do - name <- try $ do + fs' <- try $ do char '\\' - try (string "include") - <|> try (string "input") - <|> string "usepackage" - -- skip options - skipMany $ try $ char '[' *> (manyTill anyChar (char ']')) - fs <- (map trim . splitBy (==',')) <$> braced' + name <- try (string "include") + <|> try (string "input") + <|> string "usepackage" + -- skip options + skipMany $ try $ char '[' *> (manyTill anyChar (char ']')) + fs <- (map trim . splitBy (==',')) <$> braced' + return $ if name == "usepackage" + then map (flip replaceExtension ".sty") fs + else map (flip replaceExtension ".tex") fs pos <- getPosition - let fs' = if name == "usepackage" - then map (flip replaceExtension ".sty") fs - else map (flip replaceExtension ".tex") fs containers <- getState let fn = case containers of (f':_) -> f' |