4

How can I properly add a line of code in a comment like this

test test

I like it more grey than test test if that is possible.

Or if there is another way to define code in a comment to make it more clear I'd like to hear it.

1

1 Answer 1

7

In comments you are limited to just test test which is generated by the code:

`test test`

There is no way to get the larger code bar like in your example or in the line above this in a comment. This is because the comment system doesn't work at all with line breaks, etc. which the code bars like the above need.

5
  • I think it can be generalized, there are no format options to control line breaks or paragraphs, which also makes code blocks impossible and allows only inline code.
    – Byte Commander Mod
    Commented Feb 18, 2018 at 0:15
  • Is there a way to add it another way ? bold or italic or more darker background
    – An0n
    Commented Feb 18, 2018 at 0:15
  • @An0n why? Adding that effect is just going to be more 'nuisance-like' to others rather than just be a straight code line. If you're trying to share that much code that you need a code bar like in the question in a comment, you're doing it wrong.
    – Thomas Ward Mod
    Commented Feb 18, 2018 at 0:17
  • I just see when other people for example set ` sudo apt-get update ` i see it more clear then when i wrote the same comment. Thats why im asking. And offcourse if i add allot of code i just answer the question.
    – An0n
    Commented Feb 18, 2018 at 0:20
  • 1
    @An0n Then that's an issue with how you see it. It looks pretty clear on this side... unfortunately. It's pretty clearly not standard comment code on the standard site stylesheets
    – Thomas Ward Mod
    Commented Feb 18, 2018 at 0:47

You must log in to answer this question.

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