aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2025-10-18 08:11:03 +1100
committerJustin Bedo <cu@cua0.org>2025-10-18 08:11:03 +1100
commit0315502e61787969326a3cd0eaeb1009c274bb17 (patch)
tree2999a7529543f16756233a97dc6be7aa6c7bd831
parent2aea8a6983f6a212cebcf1c4aa59bf43bb98f321 (diff)
strip padding from mathHEADmaster
-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}"))