aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-05 10:11:24 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-05 10:11:24 -0800
commitd033fc9d3e2ea572bf00ca0dd04426795fab4c49 (patch)
treed504447bf5556724be1a535d357316ff00312d88
parentc949530815564d1ef9804fa9c168142c9da655b8 (diff)
downloadpandoc-d033fc9d3e2ea572bf00ca0dd04426795fab4c49.tar.gz
LaTeX reader: Skip \index commands.
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index f0b5542fa..0e376f1a5 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -40,7 +40,7 @@ import Text.Pandoc.Parsing
import Data.Maybe ( fromMaybe )
import Data.Char ( chr, toUpper )
import Data.List ( isPrefixOf, isSuffixOf )
-import Control.Monad ( when )
+import Control.Monad ( when, guard )
-- | Parse LaTeX from string and return 'Pandoc' document.
readLaTeX :: ParserState -- ^ Parser state, including options for parser
@@ -478,6 +478,7 @@ inline = choice [ str
, accentedChar
, nonbreakingSpace
, cite
+ , index
, specialChar
, rawLaTeXInline'
, escapedChar
@@ -814,6 +815,12 @@ footnote = try $ do
cite :: GenParser Char ParserState Inline
cite = simpleCite <|> complexNatbibCites
+index :: GenParser Char ParserState Inline
+index = try $ do
+ (name, _, _) <- command
+ guard $ name == "index"
+ return $ Str ""
+
simpleCiteArgs :: GenParser Char ParserState [Citation]
simpleCiteArgs = try $ do
first <- optionMaybe $ (char '[') >> manyTill inline (char ']')