TASVideos / tasvideos

The code for the live TASVideos website
https://tasvideos.org/
GNU General Public License v3.0
62 stars 29 forks source link

Escape formatting symbols for Discord publisher #1749

Closed Masterjun3 closed 6 months ago

Masterjun3 commented 6 months ago

Resolves #1698 . Escapes the formatting symbols Discord uses, so that we don't accidentally format. (Before | After) image

Sadly, I can't add ( ) [ ] to the list of escaped characters, due to the implementation of #1684 . It would break our own formatting, and there is no way to differentiate between our own formatting and accidental formatting at that point in the code.

vadosnaprimer commented 6 months ago

Does it make sense to check if the link in the TVA post is not to tasvideos, and to add an external link icon or some other indication to it?

Masterjun3 commented 6 months ago

What do you mean? Our links always point to TASVideos, don't they?

Masterjun3 commented 6 months ago

feos clarified on Discord. It seems he means links that are made by Discord from the user input.

My answer is that this is waay beyond the scope of this PR. First of all, you'd have to somehow recreate how Discord parses links, and you have to parse the [ ]( ) grammar. Since I use regex here, that will be difficult.