Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ means "reset to default".
You can specify the following flags (some flags may not be supported by your
terminal):

l: blink
b: bold
d: dim
l: blink
r: reverse (switch foreground and background color)
u: underline

Expand Down
8 changes: 4 additions & 4 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (

// Common regular expressions.
var (
colorPattern = regexp.MustCompile(`\[([a-zA-Z]+|#[0-9a-zA-Z]{6}|\-)?(:([a-zA-Z]+|#[0-9a-zA-Z]{6}|\-)?(:([lbdru]+|\-)?)?)?\]`)
colorPattern = regexp.MustCompile(`\[([a-zA-Z]+|#[0-9a-zA-Z]{6}|\-)?(:([a-zA-Z]+|#[0-9a-zA-Z]{6}|\-)?(:([bdlru]+|\-)?)?)?\]`)
regionPattern = regexp.MustCompile(`\["([a-zA-Z0-9_,;: \-\.]*)"\]`)
escapePattern = regexp.MustCompile(`\[([a-zA-Z0-9_,;: \-\."#]+)\[(\[*)\]`)
nonEscapePattern = regexp.MustCompile(`(\[[a-zA-Z0-9_,;: \-\."#]+\[*)\]`)
Expand Down Expand Up @@ -125,20 +125,20 @@ func overlayStyle(style tcell.Style, fgColor, bgColor, attributes string) tcell.

if attributes == "-" {
style = style.Bold(defAttr&tcell.AttrBold > 0)
style = style.Dim(defAttr&tcell.AttrDim > 0)
style = style.Blink(defAttr&tcell.AttrBlink > 0)
style = style.Reverse(defAttr&tcell.AttrReverse > 0)
style = style.Underline(defAttr&tcell.AttrUnderline > 0)
style = style.Dim(defAttr&tcell.AttrDim > 0)
} else if attributes != "" {
style = style.Normal()
for _, flag := range attributes {
switch flag {
case 'l':
style = style.Blink(true)
case 'b':
style = style.Bold(true)
case 'd':
style = style.Dim(true)
case 'l':
style = style.Blink(true)
case 'r':
style = style.Reverse(true)
case 'u':
Expand Down