From 8bdb26ec3a932ede0dfddcc71a9a3009c4da6e55 Mon Sep 17 00:00:00 2001 From: ayn2op Date: Mon, 2 Jun 2025 00:12:05 -0400 Subject: [PATCH] config: rename markdown_enabled to markdown --- cmd/messages_text.go | 2 +- internal/config/config.go | 3 +-- internal/config/config.toml | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/messages_text.go b/cmd/messages_text.go index 1211c8a..d2487a3 100644 --- a/cmd/messages_text.go +++ b/cmd/messages_text.go @@ -162,7 +162,7 @@ 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) - if app.cfg.MarkdownEnabled { + if app.cfg.Markdown { markdown.DefaultRenderer.Render(mt, c, ast) } else { mt.Write(c) // write the content as is diff --git a/internal/config/config.go b/internal/config/config.go index 8aa3d16..adaf97f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,12 +41,11 @@ type ( Mouse bool `toml:"mouse"` Editor string `toml:"editor"` + Markdown bool `toml:"markdown"` HideBlockedUsers bool `toml:"hide_blocked_users"` 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"` diff --git a/internal/config/config.toml b/internal/config/config.toml index 75bcfd4..c95eae5 100644 --- a/internal/config/config.toml +++ b/internal/config/config.toml @@ -7,7 +7,8 @@ editor = "default" hide_blocked_users = true show_attachment_links = true messages_limit = 50 -markdown_enabled = true +# Whether to parse and render markdown in messages or not. +markdown = true # Timestamps uses Go timestamp format # See: https://gosamples.dev/date-time-format-cheatsheet