You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll think about it. It would require me to detect whether or not the first word is a language, which means I might need to add a list of all the languages that the official discord client supports highlighting for.
It would require me to detect whether or not the first word is a language
Perhaps that shouldn't be really needed? Especially if you don't intend to actually implement syntax highlighting in dm?
I think that if you detect that a code block is multi-line (i.e., it has line breaks), you can then check if that line block has a syntax highlighting language specified by simply checking if there's a string right after the first three backticks (```). If there is, you can remove it from the code block to prevent it from being displayed.
Now of course that's easier said than done, but at least I think the logic is correct...
Hi,
As you might know, in multi-line code blocks, we are able to specify the syntax highlighting language to use.
For example, if you receive a message in Discord with the following content (a JSON snippet):
It gets displayed like this in the official client:
However, in "dm" (i.e. your client), the
json
part (i.e. the syntax highlighting language) is also displayed at the top of the code block:Please note that I'm not talking about the lack of syntax highlighting here, I'm simply asking not to display the language directly in the code block.
Perhaps it doesn't have to be removed completely, but put elsewhere as a hint for the person reading it...
Thank you!
The text was updated successfully, but these errors were encountered: