From b2661d1e10cff582c528ccf58626c4d8b2fea29d Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Sat, 2 Oct 2021 23:45:30 -0400 Subject: [PATCH] Add missing ansi translations Without these, the styles are not properly applied --- ansi.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ansi.go b/ansi.go index 294076c..30a3c3b 100644 --- a/ansi.go +++ b/ansi.go @@ -135,6 +135,10 @@ func (a *ansi) Write(text []byte) (int, error) { if strings.IndexRune(a.attributes, 'd') < 0 { a.attributes += "d" } + case "3", "03": + if strings.IndexRune(a.attributes, 'i') < 0 { + a.attributes += "i" + } case "4", "04": if strings.IndexRune(a.attributes, 'u') < 0 { a.attributes += "u" @@ -143,6 +147,14 @@ func (a *ansi) Write(text []byte) (int, error) { if strings.IndexRune(a.attributes, 'l') < 0 { a.attributes += "l" } + case "7", "07": + if strings.IndexRune(a.attributes, 'r') < 0 { + a.attributes += "r" + } + case "9", "09": + if strings.IndexRune(a.attributes, 's') < 0 { + a.attributes += "s" + } case "22": if i := strings.IndexRune(a.attributes, 'b'); i >= 0 { a.attributes = a.attributes[:i] + a.attributes[i+1:]