Bladeren bron

config: rename markdown_enabled to markdown

ayn2op 11 maanden geleden
bovenliggende
commit
8bdb26ec3a
3 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 1 1
      cmd/messages_text.go
  2. 1 2
      internal/config/config.go
  3. 2 1
      internal/config/config.toml

+ 1 - 1
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

+ 1 - 2
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"`

+ 2 - 1
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