axieum / minecord

Bring your Minecraft world into your Discord guild
https://www.curseforge.com/minecraft/mc-mods/minecord-for-discord
MIT License
15 stars 6 forks source link

Markdown formatting in Discord is lost when using Styled Chat mod #117

Open nycki93 opened 9 months ago

nycki93 commented 9 months ago

Expected behavior

Chat which appears italic/bold in minecraft should also appear italic/bold in discord.

Observed/actual behavior

When styledchat is set to parse markdown, chat in the minecraft -> minecraft direction can have italics and bold, but chat in the minecraft -> discord direction does not.

When styledchat is NOT set to parse markdown, chat in the minecraft -> discord direction can have italics and bold, but chat in the minecraft -> minecraft direction does not.

Steps/models to reproduce

install minecord and styled-chat. in styled-chat.json, set "markdown": true.

from minecraft, type:

*italics* and **bold**

in minecraft, this displays as

<~nycki> italics and bold

in discord, you should see

Overworld ~nycki > italics and bold

Version

minecraft 1.20.2 openjdk 17.0.9 fabric api 0.91.1 minecord 2.0.2 styled-chat 2.3.0 styled-nicknames 1.3.0

Agreements

Other

No response

axieum commented 9 months ago

Good pickup, thanks. I believe these old lines of code are to blame from before we moved to Text Placeholder API - https://github.com/axieum/minecord/blob/0586966e7c19c06068fc98a260cb8a9653a67ac8/minecord-chat/src/main/java/me/axieum/mcmod/minecord/impl/chat/callback/minecraft/ServerMessageCallback.java#L41-L45

I wonder if MarkdownLiteParserV1 from Text Placeholder API could be used here instead.

axieum commented 4 months ago

This will require a full featured Minecraft's Text to markdown string converter.