ProAnswers.org

Code formatting in post

Here is the way to do code(C, C++, HTML, PHP, Java, Javascript etc) formatting in posts.
keyboard1

  • Tap the blue key three times to open a code block and press enter to get to the next line.
  • Copy-paste / write the code you want to use.
  • Press enter for a new line again.
  • Then tap the blue key three times again to close the code block.

or

Another solution is to use the composer’s toolbar button. Select the text that should be formatted as code block and press the button.

editor

Depending on the value of the code_formatting_style site setting this either indents with 4 spaces or uses backticks to format the code block.

1 Like