aboutsummaryrefslogtreecommitdiff
path: root/latexfmt.hs
diff options
context:
space:
mode:
Diffstat (limited to 'latexfmt.hs')
-rw-r--r--latexfmt.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/latexfmt.hs b/latexfmt.hs
index 3a31970..371bcaf 100644
--- a/latexfmt.hs
+++ b/latexfmt.hs
@@ -101,13 +101,13 @@ lbrk = Lbrk <$ string "\\\\"
math = oldmath <|> newmath <|> oldimath <|> newimath
-oldmath = Math <$> (string "$$" *> takeWhile (/= '$')) <* string "$$"
+oldmath = Math . T.strip <$> (string "$$" *> takeWhile (/= '$')) <* string "$$"
-newmath = Math . T.pack <$> (string "\\[" *> manyTill' anyChar (string "\\]"))
+newmath = Math . T.strip . T.pack <$> (string "\\[" *> manyTill' anyChar (string "\\]"))
-oldimath = IMath <$> (string "$" *> takeWhile (/= '$')) <* string "$"
+oldimath = IMath . T.strip <$> (string "$" *> takeWhile (/= '$')) <* string "$"
-newimath = IMath . T.pack <$> (string "\\(" *> manyTill' anyChar (string "\\)"))
+newimath = IMath . T.strip . T.pack <$> (string "\\(" *> manyTill' anyChar (string "\\)"))
verbatim = Verbatim False . T.pack <$> (string "\\begin{verbatim}" *> manyTill' anyChar (string "\\end{verbatim}"))