summaryrefslogtreecommitdiff
path: root/pygments/formatters
diff options
context:
space:
mode:
authorMorten Enemark Lund <melund@gmail.com>2018-08-21 08:09:07 +0200
committerMorten Enemark Lund <melund@gmail.com>2018-08-21 08:09:07 +0200
commite22d30b61416fc024cde4f262b36383ff9b19e3b (patch)
tree817f8b1bbe9a350caa1058900a5d185f27ee3b31 /pygments/formatters
parent9ddc62fd449592eaee42b4026884b976b2fb3b64 (diff)
downloadpygments-e22d30b61416fc024cde4f262b36383ff9b19e3b.tar.gz
Ensure terminal formatter works with new ansi colors names
Diffstat (limited to 'pygments/formatters')
-rw-r--r--pygments/formatters/terminal256.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/formatters/terminal256.py b/pygments/formatters/terminal256.py
index 88bc23ce..7e9214bc 100644
--- a/pygments/formatters/terminal256.py
+++ b/pygments/formatters/terminal256.py
@@ -50,7 +50,7 @@ class EscapeSequence:
attrs = []
if self.fg is not None:
if self.fg in ansicolors:
- esc = codes[self.fg[5:]]
+ esc = codes[self.fg.lstrip('ansi')]
if ';01m' in esc:
self.bold = True
# extract fg color code.
@@ -59,7 +59,7 @@ class EscapeSequence:
attrs.extend(("38", "5", "%i" % self.fg))
if self.bg is not None:
if self.bg in ansicolors:
- esc = codes[self.bg[5:]]
+ esc = codes[self.bg.lstrip('ansi')]
# extract fg color code, add 10 for bg.
attrs.append(str(int(esc[2:4])+10))
else: