#Escape Markdown

1 messages · Page 1 of 1 (latest)

timber sage
#

I'm in the process of removing all occurences of d.py in my bot to fully use i.py. But there's one find I can't find for i.py: is there any function to escape markdown characters? Like something that takes a string as input, eg "**hello**" and outputs "\*\*hello\*\*"

topaz coveBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

winged pebble
#

I don't think so, but it's pretty simple to implement

#

just replace * with \* and same for all characters

timber sage
#

This is unfortunately not that easy. Things like "**hello" should be left unmodified. Same for links. So it would require a lot of regex hell
Guess I'll keep that bit of d.py code then

winged pebble
#

you could look at the way d.py implemented it and copy it over with i.py, I don't think it would be that hard

timber sage
#

I'll have to look at their licence, but if that's something they allow, for sure I can copy their code