First time here? Check out the FAQ!
1

How to insert code block in comment
 

I'd like to know how to insert code blocks in comments and if it possible to have the save editor for comments as you have for answers? I understand that comments should be small in general, but what if I want to have both q&a and discussions in the same place?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
rybalkin's avatar
13
rybalkin
asked 11 years ago

Comments

see more comments

1 Answer

1

If you use Markdown, configure the comment editor to be the same as the Q&A editor (in the future version this will be the default too). Then add the code blocks the same way.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago
link

Comments

1

What you mean by default? a lot will prefer text-only in comment, so if it an option to change at any time it's better. Also in Markdown for comment you can use h1 h2 h3 which is a bad idea in comments, I think we should allow only **Bold** *Italic* `code` text link ..

Mustafa's avatar Mustafa (11 years ago)
see more comments