Skip to content

Add support for chat formatting (bold, italic, underline, etc)#2851

Closed
Skylandia wants to merge 8 commits intoMCCTeam:masterfrom
Skylandia:chat-formatting
Closed

Add support for chat formatting (bold, italic, underline, etc)#2851
Skylandia wants to merge 8 commits intoMCCTeam:masterfrom
Skylandia:chat-formatting

Conversation

@Skylandia
Copy link
Copy Markdown

Needs more testing.

@Skylandia Skylandia changed the title Add support for chat formatting Add support for chat formatting (bold, italic, underline, etc) Mar 9, 2025
@milutinke
Copy link
Copy Markdown
Member

Have you tested this?
Can you provide some screenshots of how it works?

@Skylandia
Copy link
Copy Markdown
Author

demo screenshot
image
image
Featuring italics, strikethrough, and bold.

Still WIP, since the italics aren't properly applied in the screenshot.
(the link should be italicized as well)

@Skylandia
Copy link
Copy Markdown
Author

Skylandia commented Jun 13, 2025

Should be in a mergable state if nobody has any issues.

edit: just kidding this is not mergable there are still issues

@milutinke
Copy link
Copy Markdown
Member

milutinke commented Mar 20, 2026

Are all the issues fixed?
If so, I can merge it.

@milutinke
Copy link
Copy Markdown
Member

@Skylandia What are the concrete issues you were facing?

Copilot AI added a commit that referenced this pull request Mar 24, 2026
…through, obfuscated)

Re-implements PR #2851 against the current System.Text.Json.Nodes codebase.

Changes:
- ChatParser.cs: Add FormattingCodes dict, update JSONData2String to propagate
  formatting codes alongside colors, update NbtToString for the NBT chat path
  (used in MC 1.20.4+), fix root-string shortcut to preserve formatting prefix
- DiscordBridge.cs: Add GetDiscordText() converting § codes to Discord Markdown,
  handle unclosed formatting codes with end-of-string matching

End-to-end tested against Minecraft 1.21.11 (MC 26.1) offline server.
All 8 formatting types verified: bold(§l), italic(§o), strikethrough(§m),
underline(§n), combined, nested, reset-via-false, obfuscated(§k).

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/65b0d230-287c-4ed8-9b3c-a5ea25411804
@milutinke
Copy link
Copy Markdown
Member

I re-implemented this, will merge soon when it's fully tested.
Thanks for your work.

@milutinke milutinke closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants