Skip to content

Commit cdfbe11

Browse files
committed
Add <strikethrough>
1 parent 8f385a6 commit cdfbe11

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,4 @@ It's not required to close tags you've opened, though it can make for easier rea
105105
- `<blink>`
106106
- `<reverse>`
107107
- `<hidden>`
108+
- `<strikethrough>`

parser.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,22 @@ const (
3030
reverse
3131
hidden
3232
italic
33+
strikethrough
3334
)
3435

3536
var resetAll = "\x1b[0m"
3637
var resetFg = "\x1b[39m"
3738
var resetBg = "\x1b[49m"
3839

3940
var attrMap = map[uint8]string{
40-
bold: "\x1b[1m",
41-
dim: "\x1b[2m",
42-
italic: "\x1b[3m",
43-
underline: "\x1b[4m",
44-
blink: "\x1b[5m",
45-
reverse: "\x1b[7m",
46-
hidden: "\x1b[8m",
41+
bold: "\x1b[1m",
42+
dim: "\x1b[2m",
43+
italic: "\x1b[3m",
44+
underline: "\x1b[4m",
45+
blink: "\x1b[5m",
46+
reverse: "\x1b[7m",
47+
hidden: "\x1b[8m",
48+
strikethrough: "\x1b[9m",
4749
}
4850

4951
func (s *parserState) setFg(esc string) string {

tags.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ var bgTags = map[string]string{
3939
}
4040

4141
var attrTags = map[string]uint8{
42-
"bold": bold,
43-
"dim": dim,
44-
"italic": italic,
45-
"underline": underline,
46-
"blink": blink,
47-
"reverse": reverse,
48-
"hidden": hidden,
42+
"bold": bold,
43+
"dim": dim,
44+
"italic": italic,
45+
"underline": underline,
46+
"blink": blink,
47+
"reverse": reverse,
48+
"hidden": hidden,
49+
"strikethrough": strikethrough,
4950
}

0 commit comments

Comments
 (0)