aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/ANSI.hs5
-rw-r--r--test/ansi-test.ansi12
2 files changed, 7 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Writers/ANSI.hs b/src/Text/Pandoc/Writers/ANSI.hs
index 202813efa..8b6f4b3c4 100644
--- a/src/Text/Pandoc/Writers/ANSI.hs
+++ b/src/Text/Pandoc/Writers/ANSI.hs
@@ -134,17 +134,14 @@ blockToANSI _ HorizontalRule = return $ D.blankline $$ hr $$ D.blankline
blockToANSI opts (Header level (_, classes, kvs) inlines) = do
contents <- inlineListToANSI opts inlines
- inner <- gets stInner
let secnum = fromMaybe mempty $ lookup "number" kvs
let doNumber = writerNumberSections opts && not (T.null secnum) && "unnumbered" `notElem` classes
let number | doNumber = D.hang (D.realLength secnum + 1) (header level (D.literal secnum) <> D.space)
| otherwise = id
- return $ number (color inner (header level contents)) $$ D.blankline where
+ return $ number (header level contents) $$ D.blankline where
header 1 = (fmap T.toUpper) . D.bold
header 2 = D.bold
header _ = D.italic
- color False = D.fg D.green
- color True = id
-- The approach to code blocks and highlighting here is a best-effort with
-- existing tools. The Skylighting formatANSI function produces fully-rendered
diff --git a/test/ansi-test.ansi b/test/ansi-test.ansi
index e38cfafc2..5776ae262 100644
--- a/test/ansi-test.ansi
+++ b/test/ansi-test.ansi
@@ -1,20 +1,20 @@
-LEVEL 1 HEADING
+LEVEL 1 HEADING
Text
-Level 2 heading
+Level 2 heading
Text
-Level 3 heading
+Level 3 heading
Text
-Level 4 heading
+Level 4 heading
Text
-Level 5 heading
+Level 5 heading
Text
@@ -73,7 +73,7 @@ Footnote¹
Multiple blocks in a cell
────────────────── ─────────── ────────────
-COL 1 COL 2 COL 3
+COL 1 COL 2 COL 3
col 1 col 2 col 3
r1 a • b c c 2 c 2