diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-12-12 09:31:51 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-12-12 09:31:51 -0800 |
commit | af7e78243682ec7c353dd202590c45c734f86ada (patch) | |
tree | 731509a3ab17391a415bfb13c9798884569fe554 /src/Text/Pandoc/Readers/LaTeX.hs | |
parent | d9c2f500bf636dca5b7f54548faf13dfd363c53b (diff) | |
download | pandoc-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.hs | 12 |
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 |