loading...

Escaping backticks in a code block block does not work

nektro profile image Meghan Denny ・1 min read

I swear I'm not trying to find bugs in the markdown parser XD but if you escape backticks while in a code block block then it does not work.

IE what I was trying to do is show someone how to format a code block and this is what happened

  • How to reproduce
  • did 3 backticks
  • new line, 3 backticks escaped with / but backslash
  • normal code
  • 3 more escaped backticks
  • 3 actual backticks to close the block

What that looks like when done can be seen below

alt


\`\`\`ruby
require "zlib"

def compress_file(file_name)
  zipped = "#{file_name}.gz"

  Zlib::GzipWriter.open(zipped) do |gz|
    gz.write IO.binread(file_name)
  end
end
\`\`\`

edit: so it seems that in a post this works in post, but also includes the backticks. the garbled mess that I first encountered was from a comment so I'll post it there too

Posted on Aug 4 '17 by:

nektro profile

Meghan Denny

@nektro

23. Local trans witch who prefers to do magic with a keyboard. she/her. Currently hacking away at making the Web less centralized.

Discussion

markdown guide
 
\`\`\`ruby
require "zlib"

def compress_file(file_name)
  zipped = "#{file_name}.gz"

  Zlib::GzipWriter.open(zipped) do |gz|
    gz.write IO.binread(file_name)
  end
end
\`\`\`

okay, now its the same as above, idk what happened ¯\(ツ)