10

I typed ` | "a"` into a comment, but it didn't render as code. Instead, it just appears as regular text. See the comments below for examples.

11
  • 2
    proof: ` | "a"` Jan 22, 2016 at 20:04
  • 3
    ` | "a"` gets code formatting? Didn't notice the leading space. But without the space in front of the pipe, it is formatted: | "a".
    – ryanyuyu
    Jan 22, 2016 at 20:05
  • your comment got formatted when I first saw it, but not after reloading the page Jan 22, 2016 at 20:06
  • Yeah I was editing it when I noticed the leading space.
    – ryanyuyu
    Jan 22, 2016 at 20:07
  • Ah, yes. It's still there after a hard reload, so it's (probably) not a stale js cached. Jan 22, 2016 at 20:08
  • Intersting. The backticks also fail the render the leading space in your question too.
    – ryanyuyu
    Jan 22, 2016 at 20:08
  • True, I didn't notice that. Jan 22, 2016 at 20:09
  • 1
    Test comment: leading space before pipe in backticks: ` |` Leading space before any content: ` a`. Ok I guess any leading space creates a problem. You might check MSE and see if this has been previously reported.
    – ryanyuyu
    Jan 22, 2016 at 20:11
  • 1
    spaces around ascii text: ` a ` Jan 22, 2016 at 20:11
  • 1
    Found an MSE explanation
    – ryanyuyu
    Jan 22, 2016 at 20:15
  • It's still a bug. I wanted to include the space in the quote since it was important to the question. Jan 22, 2016 at 20:20

1 Answer 1

12

According to Shadow Wizard's MSE answer, spaces immediately after the opening backtick or immediately before the closing backtick will break the code rendering in comments. Within a post you can use <code> blocks instead of backticks to render the stuff properly | "a", but comments don't support <code> blocks.

Yes, this is a bug. I'm not sure what a solution would require. For now a workaround would just be to avoid using spaces next to backticks. For your comment, providing the surrounding code context might be better (endOfCondition | "a").

Not the answer you're looking for? Browse other questions tagged .