ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to enter multi-line code in our questions?

asked 2012-08-31 20:24:57 -0600

tor gravatar image

updated 2013-02-24 13:52:01 -0600

bit-pirate gravatar image

Hi All,

For me, it seems that the tool for entering code (available on the toolbar above our ros-answer-question editor) only works for one-line code; we have to click the tool again for a new line.

How if we want to enter multi-line code? Let's say, I want to copy-paste a chunk of code.

What is the trick, guys, please?

Thank you.

edit retag flag offensive close merge delete


Indent by 4 characters the whole mulitline block of code and it will be highlighted.

Evgeny gravatar image Evgeny  ( 2013-02-23 07:57:37 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-08-31 21:31:17 -0600

You can first paste the whole (multiline) code snippet, mark it afterwards and then click on the < code > icon. This should have the requested effect.

edit flag offensive delete link more


I think the editing window has changed. I don't see an < code > icon. Markdown syntax of three backticks before and after the code doesn't seem to work for multiline blocks. What's the right way?

dinosaur gravatar image dinosaur  ( 2015-06-26 12:42:11 -0600 )edit

@dinosaur: the syntax for displaying blocks of code is just to indent by 4 spaces. Alternatively, select any number of lines and click the < code > button, which is the one with '101 010'.

slelievre gravatar image slelievre  ( 2016-03-09 06:23:47 -0600 )edit

Question Tools


Asked: 2012-08-31 20:24:57 -0600

Seen: 30,614 times

Last updated: Aug 31 '12