aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph C. Sible <[email protected]>2024-12-14 02:26:56 -0500
committerJohn MacFarlane <[email protected]>2024-12-14 17:08:53 -0800
commit3f49e1a7d8af501680500e7d0b78d13c153bf32e (patch)
tree81db9b0d459b9956267e99d7bf28f52833d14361
parenta779963f1a6533e54a00ecf2e57ea0222b576962 (diff)
Put the length in the range expression instead of calling take later
-rw-r--r--src/Text/Pandoc/Writers/ANSI.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/ANSI.hs b/src/Text/Pandoc/Writers/ANSI.hs
index 92c8e0af8..60440f7ad 100644
--- a/src/Text/Pandoc/Writers/ANSI.hs
+++ b/src/Text/Pandoc/Writers/ANSI.hs
@@ -82,7 +82,7 @@ pandocToANSI opts (Pandoc meta blocks) = do
body <- blockListToANSI opts blocks'
notes <- gets $ reverse . stNotes
let notemark x = D.literal (tshow (x :: Int) <> ".") <+> D.space
- let marks = take (length notes) $ map notemark [1..]
+ let marks = map notemark [1..length notes]
let hangWidth = foldr (max . D.offset) 0 marks
let notepretty | not (null notes) = D.cblock width hr $+$ hangMarks hangWidth marks notes
| otherwise = D.empty