aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-12 09:31:51 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-12 09:31:51 -0800
commitaf7e78243682ec7c353dd202590c45c734f86ada (patch)
tree731509a3ab17391a415bfb13c9798884569fe554 /src/Text/Pandoc/Readers/LaTeX.hs
parentd9c2f500bf636dca5b7f54548faf13dfd363c53b (diff)
downloadpandoc-af7e78243682ec7c353dd202590c45c734f86ada.tar.gz
Modified readers to emit SoftBreak when appropriate.
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 6500cb29f..5a4612862 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -100,8 +100,13 @@ dimenarg = try $ do
return $ ch ++ num ++ dim
sp :: LP ()
-sp = skipMany1 $ satisfy (\c -> c == ' ' || c == '\t')
- <|> try (newline <* lookAhead anyChar <* notFollowedBy blankline)
+sp = whitespace <|> endline
+
+whitespace :: LP ()
+whitespace = skipMany1 $ satisfy (\c -> c == ' ' || c == '\t')
+
+endline :: LP ()
+endline = try (newline >> lookAhead anyChar >> notFollowedBy blankline)
isLowerHex :: Char -> Bool
isLowerHex x = x >= '0' && x <= '9' || x >= 'a' && x <= 'f'
@@ -196,7 +201,8 @@ singleQuote = do
inline :: LP Inlines
inline = (mempty <$ comment)
- <|> (space <$ sp)
+ <|> (space <$ whitespace)
+ <|> (softbreak <$ endline)
<|> inlineText
<|> inlineCommand
<|> inlineEnvironment