diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-02-27 02:35:46 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-02-27 02:35:46 +0000 |
commit | d3f1ddf57ee420cdcd573158812a7499a02c09f7 (patch) | |
tree | cfbc5dcb08f88059292c48b3f934bb45b7398e74 /src/Text/Pandoc/Readers/LaTeX.hs | |
parent | 4ded47740906e04de24c7dfa4166ef1eceefe1df (diff) | |
download | pandoc-d3f1ddf57ee420cdcd573158812a7499a02c09f7.tar.gz |
LaTeX reader: handle \ (interword space).
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1846 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index e687d1f79..1a5c37e7a 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -429,7 +429,6 @@ inline = choice [ str , whitespace , quoted , apostrophe - , spacer , strong , math , ellipses @@ -547,7 +546,15 @@ unescapedChar :: GenParser Char st Inline unescapedChar = oneOf "`$^&_#{}|<>" >>= return . (\c -> Str [c]) specialChar :: GenParser Char st Inline -specialChar = choice [ backslash, tilde, caret, bar, lt, gt, doubleQuote ] +specialChar = choice [ spacer, interwordSpace, + backslash, tilde, caret, + bar, lt, gt, doubleQuote ] + +spacer :: GenParser Char st Inline +spacer = try (string "\\,") >> return (Str "") + +interwordSpace :: GenParser Char st Inline +interwordSpace = try (string "\\ ") >> return (Str "\160") backslash :: GenParser Char st Inline backslash = try (string "\\textbackslash") >> optional (try $ string "{}") >> return (Str "\\") @@ -670,9 +677,6 @@ whitespace = many1 (oneOf "~ \t") >> return Space linebreak :: GenParser Char st Inline linebreak = try (string "\\\\") >> return LineBreak -spacer :: GenParser Char st Inline -spacer = try (string "\\,") >> return (Str "") - str :: GenParser Char st Inline str = many1 (noneOf specialChars) >>= return . Str |