replit / evalbot

A bot that speaks code
https://repl.it/site/evalbot
48 stars 6 forks source link

First word is ignored in code snippet when using @evalbot run #6

Open CameronAavik opened 6 years ago

CameronAavik commented 6 years ago

Steps to Reproduce:

  1. Add Evalbot to slack using Add to Slack on this page
  2. Invite Evalbot to a channel
  3. Type the following

    @evalbot run java ```class Main { public static void main(String[] args) { System.out.println("test"); }}```

Expected: It outputs "test" Actual: image

As you can see, it seems to throw out the word "class"

A workaround was to add either a word or newline immediately after the triple backticks. For example the following produces the expected output from above:

run java ```ignored_word class Main { public static void main(String[] args) { System.out.println("test"); }}```

amasad commented 6 years ago

I think that's actually how markdown ``` works. The first thing is the language https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting

CameronAavik commented 6 years ago

I'm talking about when you specify the language outside of it as the following image suggests: image It doesn't make sense to have to specify the language twice.

amasad commented 6 years ago

i see your point, but it just assumes correct markdown in all cases. Here is what you can do instead

@evalbot ```python print 'hello'```
amasad commented 6 years ago

actually this might only work in private dm with evalbot