2

In this comment the text:

If I'm reading phase 3 right (and just to be explicit), this means that /* Now there are other characters before the '#' */ #endif is valid, correct?

Does not have formatting for the code marked in back-ticks. And yet, here in this post, that same quote is formatted correctly.

Is this a bug?

Screenshot:

Screenshot

7
  • 2
    You left a space in there. Without the space between opening backtick and code it works just fine: /* Now there are other characters before the '#' */ #endif. Commented Jan 10, 2015 at 0:35
  • The comment you link to is also correctly formatted and looks nothing like your screenshot. Commented Jan 10, 2015 at 0:39
  • @MartijnPieters That's because I fixed it. whistles
    – animuson StaffMod
    Commented Jan 10, 2015 at 0:39
  • 1
    @animuson: Ah! Nice tune, by the way. Commented Jan 10, 2015 at 0:41
  • But, guys... that leading whitespace was significant. It was part of the actual code (and significant to the actual question).
    – Cornstalks
    Commented Jan 10, 2015 at 0:45
  • 3
    Possible duplicate of How to include new lines for code snippets inside comments?. Commented Jul 24, 2016 at 13:40
  • @PeterMortensen (and close voters): Seriously? I'm not asking about newlines, I'm asking about spaces. Sure, they're both whitespace, but I'd argue they're significantly different.
    – Cornstalks
    Commented Jul 24, 2016 at 14:27

1 Answer 1

5

Until animuson fixed the comment for you you had left a space between the opening backtick and the first slash:

` /* Now there are other characters before the '#' */ #endif`

(Indented as code to show the syntax).

To prevent confusing random ticks and ampersands and underscores in text with Markdown syntax, you cannot have spaces in between. Remove the space and it works:

/* Now there are other characters before the '#' */ #endif

There is a difference in posts that for backticks some whitespace is tolerated. Comments support only a limited subset of Markdown.

I'm not aware of any workaround that'll let you use leading whitespace in backticks in a comment.

4
  • But why does it render correctly in my post here, but not in the comment? Why are the two rendered differently?
    – Cornstalks
    Commented Jan 10, 2015 at 0:46
  • I often want to show an image or multi-line formatted code in a comment, when requesting clarification or suggesting an intermediate step towards what will be an Answer later on. Should I post an Answer qualified with "THIS IS NOT YET THE FINAL ANSWER" or should I post the code or image on another site and add a link? What is the proper thing to do? Commented Jan 10, 2015 at 17:43
  • @TomRobinson: post an answer only to actually answer the question. If you really need to illustrate a point better in comments, use an external site; I like gist.github.com for code, or various online REPL sites for regexes and code demos, etc. Commented Jan 10, 2015 at 18:16
  • Just ran into this trying to comment with a simple regex for a space with repetition ` +`. Thanks for the explanation. Commented Apr 27, 2016 at 0:12

You must log in to answer this question.

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