2

This is a question about how to insert code the right way when you have to insert a bunch of code or multiple lines.

Is there a better way than

-Insert the code

-Go trough every line and add 4 gaps with the space key.

I am looking for a much easier solution

1 Answer 1

4

Select the code you write in your post, and click on the fifth icon from the left, in the toolbar shown on top of where you write a post.

<?php
  if (is_admin($user)) {
    show_admin_flags();
  }
?>

screenshot

2
  • This adds 3 spaces to the first line of the code in the clippboard but what if you have 5 or let's say 25 lines of code to illustrate a complex problem
    – Josh
    Commented May 1, 2015 at 14:24
  • 1
    It adds 4 spaces at the beginning of every line you select. It doesn't do anything to the clipboard content.
    – avpaderno Mod
    Commented May 1, 2015 at 14:35

You must log in to answer this question.

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