mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
fix: do not prepend bg:
to noinherit
style directives (#4939)
Pygments does not understand a "background" of `noinherit`, only `noinherit` -- so if we are setting `noinherit`, even for a background color, we do not prepend `bg:`
This commit is contained in:
parent
84405423df
commit
7365ad1bc0
2 changed files with 28 additions and 1 deletions
24
news/no_background_inherit.rst
Normal file
24
news/no_background_inherit.rst
Normal file
|
@ -0,0 +1,24 @@
|
|||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* ``pygments`` startup crash when incorrect prepending ``bg:`` to ``noinherit``
|
||||
style directives
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -177,7 +177,10 @@ def color_name_to_pygments_code(name, styles):
|
|||
fgcolor = color
|
||||
else:
|
||||
fgcolor = styles[getattr(Color, color)]
|
||||
res = "bg:" + fgcolor
|
||||
if fgcolor == "noinherit":
|
||||
res = "noinherit"
|
||||
else:
|
||||
res = f"bg:{fgcolor}"
|
||||
else:
|
||||
# have regular, non-background color
|
||||
mods = parts["modifiers"]
|
||||
|
|
Loading…
Add table
Reference in a new issue