-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
source command does not have an escape sequence for the markdown #79
Comments
I started implementing this by just making the def __init__(self, ...):
self.escape_code_blocks = False
if '```' in prefix and '```' in suffix:
self.escape_code_blocks = True
def add_line(self, line):
if self.escape_code_blocks:
line = line.replace('```', '``\N{zero width space}`')
super().add_line(line) Let me know what you think @Gorialis |
i have earlier used discord.utils.escape_markdown from the discordpy library in my project isn't it possible to use that function? |
I merged #92 a while ago, but I realized in auditing later that it actually produces a lot of formatting inconsistencies (all underscores get "escaped"). I'll probably end up favoring this implementation, but we'll see how it goes when I have time to do some proper QA. |
Discord recently added an interactive, syntax highlighted, file preview feature on the desktop and web clients. As this is the most common usage vector for Jishaku, and the intuitiveness greatly exceeds home-rolled solutions, as of 9099fe0, Jishaku will now check the file upload limit and, if the source file content fits within it, will upload the content as a file instead. This circumvents the need for escaping in this case, but in the case it does not fit, the handling has been changed to favor @iomintz 's implementation. |
see the above image
The text was updated successfully, but these errors were encountered: