Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
nycki93 opened this issue Dec 6, 2023 · 2 comments
Open
3 tasks done

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

nycki93 opened this issue Dec 6, 2023 · 2 comments
Labels
compatibility Something related to another project isn't working enhancement New feature or request minecord-chat Improvements or additions to the chat module

Comments

@nycki93
Copy link

nycki93 commented Dec 6, 2023

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

  • I am running the latest version of the mod.
  • My version of Minecraft is supported.
  • I have searched for and ensured there isn't already an open issue regarding this.

Other

No response

@axieum
Copy link
Owner

axieum commented Dec 7, 2023

Good pickup, thanks. I believe these old lines of code are to blame from before we moved to Text Placeholder API -

final PlaceholderContext ctx = PlaceholderContext.of(player);
final Map<String, PlaceholderHandler> placeholders = Map.of(
// The formatted message contents
"message", string(StringUtils.minecraftToDiscord(message.getContent().getString()))
);

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

@axieum axieum added enhancement New feature or request minecord-chat Improvements or additions to the chat module compatibility Something related to another project isn't working labels Dec 7, 2023
@axieum axieum changed the title markdown support conflicts with styled-chat Markdown formatting in Discord is lost when using Styled Chat mod Dec 7, 2023
@axieum
Copy link
Owner

axieum commented May 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Something related to another project isn't working enhancement New feature or request minecord-chat Improvements or additions to the chat module
Projects
None yet
Development

No branches or pull requests

2 participants