summaryrefslogtreecommitdiff
path: root/pygments/formatters
diff options
context:
space:
mode:
authorMorten Enemark Lund <melund@gmail.com>2018-08-21 08:34:47 +0200
committerMorten Enemark Lund <melund@gmail.com>2018-08-21 08:34:47 +0200
commitd85884690446646a59834a510157b4fffbb3ff9e (patch)
treea7fa3875eb55fdfcaf08ce84e2a61c22c29fc2e5 /pygments/formatters
parente22d30b61416fc024cde4f262b36383ff9b19e3b (diff)
downloadpygments-d85884690446646a59834a510157b4fffbb3ff9e.tar.gz
Use replace instead of strip
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 7e9214bc..aec19804 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.lstrip('ansi')]
+ esc = codes[self.fg.replace('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.lstrip('ansi')]
+ esc = codes[self.bg.replace('ansi','')]
# extract fg color code, add 10 for bg.
attrs.append(str(int(esc[2:4])+10))
else: