feat: add ability to disable markdown (#544)
This commit is contained in:
parent
5efbed2d8c
commit
af2b0995ba
2 changed files with 9 additions and 1 deletions
|
|
@ -162,7 +162,11 @@ func (mt *MessagesText) drawAuthor(msg discord.Message) {
|
|||
func (mt *MessagesText) drawContent(msg discord.Message) {
|
||||
c := []byte(tview.Escape(msg.Content))
|
||||
ast := discordmd.ParseWithMessage(c, *discordState.Cabinet, &msg, false)
|
||||
markdown.DefaultRenderer.Render(mt, c, ast)
|
||||
if app.cfg.MarkdownEnabled {
|
||||
markdown.DefaultRenderer.Render(mt, c, ast)
|
||||
} else {
|
||||
mt.Write(c) // write the content as is
|
||||
}
|
||||
}
|
||||
|
||||
func (mt *MessagesText) drawSnapshotContent(msg discord.MessageSnapshotMessage) {
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ type (
|
|||
ShowAttachmentLinks bool `toml:"show_attachment_links"`
|
||||
MessagesLimit uint8 `toml:"messages_limit"`
|
||||
|
||||
MarkdownEnabled bool `toml:"markdown_enabled"`
|
||||
|
||||
Timestamps Timestamps `toml:"timestamps"`
|
||||
Identify Identify `toml:"identify"`
|
||||
Notifications Notifications `toml:"notifications"`
|
||||
|
|
@ -63,6 +65,8 @@ func defaultConfig() *Config {
|
|||
ShowAttachmentLinks: true,
|
||||
MessagesLimit: 50,
|
||||
|
||||
MarkdownEnabled: true,
|
||||
|
||||
Timestamps: Timestamps{
|
||||
Enabled: true,
|
||||
Format: time.Kitchen,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue