diff options
author | Justin Bedo <cu@cua0.org> | 2025-10-18 08:11:03 +1100 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2025-10-18 08:11:03 +1100 |
commit | 0315502e61787969326a3cd0eaeb1009c274bb17 (patch) | |
tree | 2999a7529543f16756233a97dc6be7aa6c7bd831 | |
parent | 2aea8a6983f6a212cebcf1c4aa59bf43bb98f321 (diff) |
-rw-r--r-- | latexfmt.hs | 8 |
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}")) |