Skip to content

Commit

Permalink
fix: Add missing CSS class to the ANSI stylesheet
Browse files Browse the repository at this point in the history
For some reason, pygments-ansi-color sometimes output `-Color-BrightRed` CSS classes instead of `-Color-Bold-Red`. These class weren't declared so spans with these classes were unstyled. We fix this by adding such classes for each color.

Issue-43: #43
  • Loading branch information
pawamoy committed Apr 15, 2024
1 parent 681c4e2 commit 51493f2
Showing 1 changed file with 97 additions and 8 deletions.
105 changes: 97 additions & 8 deletions src/markdown_exec/ansi.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,57 @@

.-Color-Green,
.-Color-Faint-Green,
.-Color-Bold-Green {
.-Color-Bold-Green,
.-Color-BrightGreen {
color: var(--ansi-green);
}

.-Color-Red,
.-Color-Faint-Red,
.-Color-Bold-Red {
.-Color-Bold-Red,
.-Color-BrightRed {
color: var(--ansi-red);
}

.-Color-Yellow,
.-Color-Faint-Yellow,
.-Color-Bold-Yellow {
.-Color-Bold-Yellow,
.-Color-BrightYellow {
color: var(--ansi-yellow);
}

.-Color-Blue,
.-Color-Faint-Blue,
.-Color-Bold-Blue {
.-Color-Bold-Blue,
.-Color-BrightBlue {
color: var(--ansi-blue);
}

.-Color-Magenta,
.-Color-Faint-Magenta,
.-Color-Bold-Magenta {
.-Color-Bold-Magenta,
.-Color-BrightMagenta {
color: var(--ansi-magenta);
}

.-Color-Cyan,
.-Color-Faint-Cyan,
.-Color-Bold-Cyan {
.-Color-Bold-Cyan,
.-Color-BrightCyan {
color: var(--ansi-cyan);
}

.-Color-White,
.-Color-Faint-White,
.-Color-Bold-White {
.-Color-Bold-White,
.-Color-BrightWhite {
color: var(--ansi-white);
}

.-Color-Black,
.-Color-Faint-Black,
.-Color-Bold-Black {
.-Color-Bold-Black,
.-Color-BrightBlack {
color: var(--ansi-black);
}

Expand All @@ -73,14 +81,23 @@
.-Color-Black-BGBlack,
.-Color-Blue-BGBlack,
.-Color-Bold-BGBlack,
.-Color-BrightBGBlack,
.-Color-Bold-Black-BGBlack,
.-Color-BrightBlack-BGBlack,
.-Color-Bold-Green-BGBlack,
.-Color-BrightGreen-BGBlack,
.-Color-Bold-Cyan-BGBlack,
.-Color-BrightCyan-BGBlack,
.-Color-Bold-Blue-BGBlack,
.-Color-BrightBlue-BGBlack,
.-Color-Bold-Magenta-BGBlack,
.-Color-BrightMagenta-BGBlack,
.-Color-Bold-Red-BGBlack,
.-Color-BrightRed-BGBlack,
.-Color-Bold-White-BGBlack,
.-Color-BrightWhite-BGBlack,
.-Color-Bold-Yellow-BGBlack,
.-Color-BrightYellow-BGBlack,
.-Color-Cyan-BGBlack,
.-Color-Green-BGBlack,
.-Color-Magenta-BGBlack,
Expand All @@ -94,14 +111,23 @@
.-Color-Black-BGRed,
.-Color-Blue-BGRed,
.-Color-Bold-BGRed,
.-Color-BrightBGRed,
.-Color-Bold-Black-BGRed,
.-Color-BrightBlack-BGRed,
.-Color-Bold-Green-BGRed,
.-Color-BrightGreen-BGRed,
.-Color-Bold-Cyan-BGRed,
.-Color-BrightCyan-BGRed,
.-Color-Bold-Blue-BGRed,
.-Color-BrightBlue-BGRed,
.-Color-Bold-Magenta-BGRed,
.-Color-BrightMagenta-BGRed,
.-Color-Bold-Red-BGRed,
.-Color-BrightRed-BGRed,
.-Color-Bold-White-BGRed,
.-Color-BrightWhite-BGRed,
.-Color-Bold-Yellow-BGRed,
.-Color-BrightYellow-BGRed,
.-Color-Cyan-BGRed,
.-Color-Green-BGRed,
.-Color-Magenta-BGRed,
Expand All @@ -115,14 +141,23 @@
.-Color-Black-BGGreen,
.-Color-Blue-BGGreen,
.-Color-Bold-BGGreen,
.-Color-BrightBGGreen,
.-Color-Bold-Black-BGGreen,
.-Color-BrightBlack-BGGreen,
.-Color-Bold-Green-BGGreen,
.-Color-BrightGreen-BGGreen,
.-Color-Bold-Cyan-BGGreen,
.-Color-BrightCyan-BGGreen,
.-Color-Bold-Blue-BGGreen,
.-Color-BrightBlue-BGGreen,
.-Color-Bold-Magenta-BGGreen,
.-Color-BrightMagenta-BGGreen,
.-Color-Bold-Red-BGGreen,
.-Color-BrightRed-BGGreen,
.-Color-Bold-White-BGGreen,
.-Color-BrightWhite-BGGreen,
.-Color-Bold-Yellow-BGGreen,
.-Color-BrightYellow-BGGreen,
.-Color-Cyan-BGGreen,
.-Color-Green-BGGreen,
.-Color-Magenta-BGGreen,
Expand All @@ -136,14 +171,23 @@
.-Color-Black-BGYellow,
.-Color-Blue-BGYellow,
.-Color-Bold-BGYellow,
.-Color-BrightBGYellow,
.-Color-Bold-Black-BGYellow,
.-Color-BrightBlack-BGYellow,
.-Color-Bold-Green-BGYellow,
.-Color-BrightGreen-BGYellow,
.-Color-Bold-Cyan-BGYellow,
.-Color-BrightCyan-BGYellow,
.-Color-Bold-Blue-BGYellow,
.-Color-BrightBlue-BGYellow,
.-Color-Bold-Magenta-BGYellow,
.-Color-BrightMagenta-BGYellow,
.-Color-Bold-Red-BGYellow,
.-Color-BrightRed-BGYellow,
.-Color-Bold-White-BGYellow,
.-Color-BrightWhite-BGYellow,
.-Color-Bold-Yellow-BGYellow,
.-Color-BrightYellow-BGYellow,
.-Color-Cyan-BGYellow,
.-Color-Green-BGYellow,
.-Color-Magenta-BGYellow,
Expand All @@ -157,14 +201,23 @@
.-Color-Black-BGBlue,
.-Color-Blue-BGBlue,
.-Color-Bold-BGBlue,
.-Color-BrightBGBlue,
.-Color-Bold-Black-BGBlue,
.-Color-BrightBlack-BGBlue,
.-Color-Bold-Green-BGBlue,
.-Color-BrightGreen-BGBlue,
.-Color-Bold-Cyan-BGBlue,
.-Color-BrightCyan-BGBlue,
.-Color-Bold-Blue-BGBlue,
.-Color-BrightBlue-BGBlue,
.-Color-Bold-Magenta-BGBlue,
.-Color-BrightMagenta-BGBlue,
.-Color-Bold-Red-BGBlue,
.-Color-BrightRed-BGBlue,
.-Color-Bold-White-BGBlue,
.-Color-BrightWhite-BGBlue,
.-Color-Bold-Yellow-BGBlue,
.-Color-BrightYellow-BGBlue,
.-Color-Cyan-BGBlue,
.-Color-Green-BGBlue,
.-Color-Magenta-BGBlue,
Expand All @@ -178,14 +231,23 @@
.-Color-Black-BGMagenta,
.-Color-Blue-BGMagenta,
.-Color-Bold-BGMagenta,
.-Color-BrightBGMagenta,
.-Color-Bold-Black-BGMagenta,
.-Color-BrightBlack-BGMagenta,
.-Color-Bold-Green-BGMagenta,
.-Color-BrightGreen-BGMagenta,
.-Color-Bold-Cyan-BGMagenta,
.-Color-BrightCyan-BGMagenta,
.-Color-Bold-Blue-BGMagenta,
.-Color-BrightBlue-BGMagenta,
.-Color-Bold-Magenta-BGMagenta,
.-Color-BrightMagenta-BGMagenta,
.-Color-Bold-Red-BGMagenta,
.-Color-BrightRed-BGMagenta,
.-Color-Bold-White-BGMagenta,
.-Color-BrightWhite-BGMagenta,
.-Color-Bold-Yellow-BGMagenta,
.-Color-BrightYellow-BGMagenta,
.-Color-Cyan-BGMagenta,
.-Color-Green-BGMagenta,
.-Color-Magenta-BGMagenta,
Expand All @@ -199,14 +261,23 @@
.-Color-Black-BGCyan,
.-Color-Blue-BGCyan,
.-Color-Bold-BGCyan,
.-Color-BrightBGCyan,
.-Color-Bold-Black-BGCyan,
.-Color-BrightBlack-BGCyan,
.-Color-Bold-Green-BGCyan,
.-Color-BrightGreen-BGCyan,
.-Color-Bold-Cyan-BGCyan,
.-Color-BrightCyan-BGCyan,
.-Color-Bold-Blue-BGCyan,
.-Color-BrightBlue-BGCyan,
.-Color-Bold-Magenta-BGCyan,
.-Color-BrightMagenta-BGCyan,
.-Color-Bold-Red-BGCyan,
.-Color-BrightRed-BGCyan,
.-Color-Bold-White-BGCyan,
.-Color-BrightWhite-BGCyan,
.-Color-Bold-Yellow-BGCyan,
.-Color-BrightYellow-BGCyan,
.-Color-Cyan-BGCyan,
.-Color-Green-BGCyan,
.-Color-Magenta-BGCyan,
Expand All @@ -220,14 +291,23 @@
.-Color-Black-BGWhite,
.-Color-Blue-BGWhite,
.-Color-Bold-BGWhite,
.-Color-BrightBGWhite,
.-Color-Bold-Black-BGWhite,
.-Color-BrightBlack-BGWhite,
.-Color-Bold-Green-BGWhite,
.-Color-BrightGreen-BGWhite,
.-Color-Bold-Cyan-BGWhite,
.-Color-BrightCyan-BGWhite,
.-Color-Bold-Blue-BGWhite,
.-Color-BrightBlue-BGWhite,
.-Color-Bold-Magenta-BGWhite,
.-Color-BrightMagenta-BGWhite,
.-Color-Bold-Red-BGWhite,
.-Color-BrightRed-BGWhite,
.-Color-Bold-White-BGWhite,
.-Color-BrightWhite-BGWhite,
.-Color-Bold-Yellow-BGWhite,
.-Color-BrightYellow-BGWhite,
.-Color-Cyan-BGWhite,
.-Color-Green-BGWhite,
.-Color-Magenta-BGWhite,
Expand All @@ -239,21 +319,30 @@

.-Color-Black,
.-Color-Bold-Black,
.-Color-BrightBlack,
.-Color-Black-BGBlack,
.-Color-Bold-Black-BGBlack,
.-Color-BrightBlack-BGBlack,
.-Color-Black-BGGreen,
.-Color-Red-BGRed,
.-Color-Bold-Red-BGRed,
.-Color-BrightRed-BGRed,
.-Color-Bold-Blue-BGBlue,
.-Color-BrightBlue-BGBlue,
.-Color-Blue-BGBlue {
text-shadow: 0 0 1px var(--ansi-white);
}

.-Color-Bold-Cyan-BGCyan,
.-Color-BrightCyan-BGCyan,
.-Color-Bold-Magenta-BGMagenta,
.-Color-BrightMagenta-BGMagenta,
.-Color-Bold-White,
.-Color-BrightWhite,
.-Color-Bold-Yellow-BGYellow,
.-Color-BrightYellow-BGYellow,
.-Color-Bold-Green-BGGreen,
.-Color-BrightGreen-BGGreen,
.-Color-Cyan-BGCyan,
.-Color-Cyan-BGGreen,
.-Color-Green-BGCyan,
Expand Down

0 comments on commit 51493f2

Please sign in to comment.