Skip to content

Instantly share code, notes, and snippets.

@zverok
Last active January 19, 2020 12:12
Show Gist options
  • Save zverok/a4fcacab3dc06d9d7585c82cad8a8dc6 to your computer and use it in GitHub Desktop.
Save zverok/a4fcacab3dc06d9d7585c82cad8a8dc6 to your computer and use it in GitHub Desktop.
Example of how Ruby's error formatting breaks Markdown

(Just quick copy-paste into the dialog/GitHub issue.)

Ugh, do you know why am I having undefined local variable or method foo' for main:Object?.. I expected it to work for Logger`.

Source:

Ugh, do you know why am I having undefined local variable or method `foo' for main:Object?.. I expected it to work for `Logger`.

(Note: on GitHub it is not broken if it is the only backtick in line, that's why I added Logger. But in many other sources -- and in Gist editing mode highlight -- single backtick is a problem, too)

(Here, I'll try to screen it with ` char before and after error message)

Hey, while running the code, I saw undefined local variable or method foo' for main:Object. Any ideas?.. I just need Logger`.

Source:

Hey, while running the code, I saw `undefined local variable or method `foo' for main:Object`. Any ideas?.. I just need `Logger`.

(Maybe blockquoting will help?..)

In the example code, I somehow receive

undefined local variable or method `foo' for main:Object

Why?.. Logger worked before.

(Well, at least in Gist it is ignored when on separate line, though in Slack it doesn't)

In your code, I receive

undefined local variable or method `foo' for main:Object

Any ideas?

(It requires three lines, two with thriple-backticks and copy-paste between them)

Source:

  In your code, I receive
  \```
  undefined local variable or method `foo' for main:Object
  \```
  Any ideas?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment