Skip to content

Commit

Permalink
Allow disabling formatting / emphasis of text from Mattermost markdow…
Browse files Browse the repository at this point in the history
…n to IRC
  • Loading branch information
hloeung committed Sep 27, 2023
1 parent 98a3ead commit 3bc2cf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions matterircd.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ ShowMentions = false
# This disables that making them appear as normal PRIVMSGs.
#DisableDefaultMentions = true

# Disable formatting / emphasis of text from Mattermost markdown to IRC (bold & italics)
#DisableIRCEmphasis = true

# Enable syntax highlighting for code blocks.
# Formatter and Style are passed through to the chroma v2 package.
# https://github.com/alecthomas/chroma/blob/master/formatters/tty_indexed.go#L262
Expand Down
4 changes: 2 additions & 2 deletions mm-go-irckit/userbridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (u *User) handleDirectMessageEvent(event *bridge.DirectMessageEvent) {
continue
}

if !codeBlockBackTick && !codeBlockTilde {
if !u.v.GetBool(u.br.Protocol()+".disableircemphasis") && !codeBlockBackTick && !codeBlockTilde {
text = markdown2irc(text)
}

Expand Down Expand Up @@ -311,7 +311,7 @@ func (u *User) handleChannelMessageEvent(event *bridge.ChannelMessageEvent) {
continue
}

if !codeBlockBackTick && !codeBlockTilde {
if !u.v.GetBool(u.br.Protocol()+".disableircemphasis") && !codeBlockBackTick && !codeBlockTilde {
text = markdown2irc(text)
}

Expand Down

0 comments on commit 3bc2cf3

Please sign in to comment.