Skip to content

Commit

Permalink
Exclude reverse color too
Browse files Browse the repository at this point in the history
  • Loading branch information
hloeung committed Sep 27, 2023
1 parent 4a9e5cb commit 04df541
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm-go-irckit/server_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ func CmdWhois(s Server, u *User, msg *irc.Message) error {

//nolint:funlen
func irc2markdown(msg string) string {
// https://modern.ircdocs.horse/formatting.html
emphasisSupported := map[byte][]byte{
'\x02': {'*', '*'}, // Bold 0x02 ** (**text**)
'\x1d': {'_'}, // Italics 0x1D _ (_text_)
Expand All @@ -821,6 +822,7 @@ func irc2markdown(msg string) string {
emphasisUnsupported := map[byte]string{
'\x1f': "", // Underline 0x1f
'\x1e': "", // Strikethr 0x1e
'\x16': "", // Reverse Color
}

var buf []byte
Expand Down Expand Up @@ -853,7 +855,7 @@ func irc2markdown(msg string) string {

buf = append(buf, emp...)

// Remove closing emphasis
// Closing emphasis, they're in pairs, remove for list of outstanding
found := false
var newEmphasis []byte
for _, c := range currentEmphasis {
Expand Down

0 comments on commit 04df541

Please sign in to comment.