ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.4k stars 2.29k forks source link

Markdown renderer for Chat System #9145

Open Stewie410 opened 4 years ago

Stewie410 commented 4 years ago

Describe the new feature: Markdown support, in some form or another, is pretty common in a lot of text-based chat systems; such as Messenger, Discord, Telegram, etc. While this is relative "eye-candy", the ability to add emphasis to words in chat; or slight formatting changes to text would be useful.

Proposal designs of the feature: A "simple" parsing/rendering engine for basic/common Markdown syntax; such as bold, italic & monospace fonts. Syntax would likely need to be adjusted to allow for the formatting characters to need to be used in common conversation; so GFM may not be suitable variant.

Telegram, for example, uses the following syntax:

**bold**
__italic__
```monospace``` (full-line)
jubiman commented 4 years ago

I've looked into this and I think that with the way the current message system is written, it won't be possible to do any markdown other than links, which is already implemented. I couldn't seem to find any way of bolding text.

bdach commented 4 years ago

I'm pretty sure that asserting that it's "not possible" is incorrect. The most obvious way I can think of would involve framework's MarkdownContainer, but care has to be taken to make sure that the current handling of beatmap/profile links in chat messages is preserved, so it's not an instant replacement.

peppy commented 4 years ago

This requires osu-web support first. I am 99.9% sure an issue already exists there covering this.

bdach commented 4 years ago

There was a passing mention in the now-closed to-do list issue (#988). Can't find anything more specific than that.

peppy commented 4 years ago

In discussion with osu-web team this sounds like it could be pretty easy to implement, but the web-side implementation should come first. We'll see when that happens.