File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 44 "fmt"
55 "io"
66 "os"
7+ "regexp"
78 "strings"
89 "text/tabwriter"
910 "time"
@@ -154,7 +155,7 @@ func renderPlain(w io.Writer, data tui.TableData) error {
154155 for _ , items := range data {
155156 n := len (items )
156157 for j , v := range items {
157- _ , _ = fmt .Fprintf (w , "%s" , v )
158+ _ , _ = fmt .Fprintf (w , "%s" , unescape ( v ) )
158159 if j != n - 1 {
159160 _ , _ = fmt .Fprintf (w , "\t " )
160161 }
@@ -168,6 +169,11 @@ func renderPlain(w io.Writer, data tui.TableData) error {
168169 return nil
169170}
170171
172+ func unescape (s string ) string {
173+ pattern := regexp .MustCompile (`(\[[a-zA-Z0-9_,;: \-\."#]+\[*)\[\]` )
174+ return pattern .ReplaceAllString (s , "$1]" )
175+ }
176+
171177func coloredOut (msg string , clr color.Attribute , attrs ... color.Attribute ) string {
172178 c := color .New (clr ).Add (attrs ... )
173179 return c .Sprint (msg )
You can’t perform that action at this time.
0 commit comments