Skip to content

Commit 6c93dba

Browse files
committed
fix: remove style NoBold and add Unknown to handleSgr
Fixes: #43
1 parent 35d77ad commit 6c93dba

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ var sgr = map[string]string{
180180
"style 4": new(ansi.Style).BackgroundColor(ansi.BrightYellow).ForegroundColor(ansi.Black).UnderlineColor(ansi.BrightCyan).String(),
181181
"style 5": new(ansi.Style).BackgroundColor(ansi.TrueColor(0xffeeaa)).ForegroundColor(ansi.TrueColor(0xffeeaa)).UnderlineColor(ansi.TrueColor(0xffeeaa)).String(),
182182
"style 6": new(ansi.Style).BackgroundColor(ansi.ExtendedColor(255)).ForegroundColor(ansi.ExtendedColor(255)).UnderlineColor(ansi.ExtendedColor(255)).String(),
183-
"style 7": new(ansi.Style).NoUnderline().NoBold().NoItalic().NormalIntensity().NoBlink().NoConceal().NoReverse().NoStrikethrough().String(),
183+
"style 7": new(ansi.Style).NoUnderline().NoItalic().NormalIntensity().NoBlink().NoConceal().NoReverse().NoStrikethrough().String(),
184184
"style 8": new(ansi.Style).UnderlineStyle(ansi.NoUnderlineStyle).DefaultBackgroundColor().String(),
185185
"style 9": strings.Replace(new(ansi.Style).UnderlineStyle(ansi.SingleUnderlineStyle).DefaultForegroundColor().String(), "[4", "[4:1", 1),
186186
"style 10": new(ansi.Style).UnderlineStyle(ansi.DoubleUnderlineStyle).String(),

sgr.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ func handleSgr(p *ansi.Parser) (string, error) { //nolint:unparam
6464
str += "Invisible"
6565
case 9:
6666
str += "Crossed-out"
67-
case 21:
68-
str += "No bold"
6967
case 22:
7068
str += "Normal intensity"
7169
case 23:
@@ -103,6 +101,8 @@ func handleSgr(p *ansi.Parser) (string, error) { //nolint:unparam
103101
str += fmt.Sprintf("ANSI foreground color: Bright %s", basicColors[param.Param(0)-90])
104102
case 100, 101, 102, 103, 104, 105, 106, 107:
105103
str += fmt.Sprintf("ANSI background color: Bright %s", basicColors[param.Param(0)-100])
104+
default:
105+
str += "Unknown"
106106
}
107107
}
108108

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CSI 24;21;23;22;25;28;27;29m: No underline, No bold, No italic, Normal intensity, No blink, No conceal, No reverse, No crossed-out
1+
CSI 24;23;22;25;28;27;29m: No underline, No italic, Normal intensity, No blink, No conceal, No reverse, No crossed-out

0 commit comments

Comments
 (0)