gurkult / gurkbot

Our community bot, used for running the server.
MIT License
18 stars 16 forks source link

fixed eval bug when language is given in codeblock #82

Closed vivax3794 closed 3 years ago

vivax3794 commented 3 years ago

Fixes #74

vivax3794 commented 3 years ago

there is still a variation of the bug if the first line of the code is py/python or whatever the lang is, but I find it unlikely this will happen anyway.

vivax3794 commented 3 years ago

wait never mind, still broken image

vivax3794 commented 3 years ago

this is not perfect BUT I have narrowed the amount of situations the bug will happen (when looking at the first line) from infinity to 1

vivax3794 commented 3 years ago

the bug still triggers if the first line of the code matches the lang exactly for, or when the lang in the codeblock and the one outside are different.

vivax3794 commented 3 years ago

okay I just thought of something much simpler and it works for all the situations

Shivansh-007 commented 3 years ago

Can someone quickly have a look at this so that we can merge this?