evalbot icon indicating copy to clipboard operation
evalbot copied to clipboard

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

Open CameronAavik opened this issue 7 years ago • 4 comments

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"); }}```

CameronAavik avatar Feb 03 '18 06:02 CameronAavik

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

amasad avatar Feb 03 '18 06:02 amasad

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.

CameronAavik avatar Feb 03 '18 06:02 CameronAavik

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 avatar Feb 03 '18 06:02 amasad

actually this might only work in private dm with evalbot

amasad avatar Feb 03 '18 06:02 amasad