diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-09-02 00:36:44 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-09-02 00:36:44 +0000 |
commit | 0982a67585ca46aa1527d3cb6c744715c7c6dc07 (patch) | |
tree | 21ac33ef7a49bed3c2b9cb620514a1b40e9694b4 | |
parent | f6043ef7bf103e2665c32347cff125b5df9098b5 (diff) | |
download | pandoc-0982a67585ca46aa1527d3cb6c744715c7c6dc07.tar.gz |
LaTeX command and environment names can't contain numbers.
LaTeX reader updated accordingly.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@987 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 16ccf77fc..77c642e7e 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -71,7 +71,7 @@ commandArgs = many optOrArg -- | Parses LaTeX command, returns (name, star, list of options or arguments). command = do char '\\' - name <- many1 alphaNum + name <- many1 letter star <- option "" (string "*") -- some commands have starred versions args <- commandArgs return (name, star, args) @@ -93,7 +93,7 @@ environment name = try $ begin name >> spaces >> manyTill block (end name) anyEnvironment = try $ do string "\\begin{" - name <- many alphaNum + name <- many letter star <- option "" (string "*") -- some environments have starred variants char '}' optional commandArgs @@ -341,7 +341,7 @@ specialEnvironment = do -- these are always parsed as raw rawLaTeXEnvironment :: GenParser Char st Block rawLaTeXEnvironment = try $ do string "\\begin{" - name <- many1 alphaNum + name <- many1 letter star <- option "" (string "*") -- for starred variants let name' = name ++ star char '}' @@ -421,7 +421,7 @@ accentedChar = normalAccentedChar <|> specialAccentedChar normalAccentedChar = try $ do char '\\' accent <- oneOf "'`^\"~" - character <- (try $ char '{' >> alphaNum >>~ char '}') <|> alphaNum + character <- (try $ char '{' >> letter >>~ char '}') <|> letter let table = fromMaybe [] $ lookup character accentTable let result = case lookup accent table of Just num -> chr num |