diff --git a/src/Text/Pandoc/Writers/Blaze.hs b/src/Text/Pandoc/Writers/Blaze.hs index 4bd21b789..8233043a3 100644 --- a/src/Text/Pandoc/Writers/Blaze.hs +++ b/src/Text/Pandoc/Writers/Blaze.hs @@ -113,8 +113,8 @@ toChunks :: Text -> [Doc Text] toChunks = map toDoc . T.groupBy sameStatus where toDoc t - | T.any (== ' ') t = space - | T.any (== '\n') t = cr + | t == " " = space + | t == "\n" = cr | otherwise = literal t sameStatus c d = (c == ' ' && d == ' ') || diff --git a/test/command/4639.md b/test/command/4639.md index 31ac3a5d9..c35df1749 100644 --- a/test/command/4639.md +++ b/test/command/4639.md @@ -5,6 +5,6 @@ \end{equation} ^D

\[\begin{equation} -E=mc^2 + E=mc^2 \end{equation}\]

```