Users will have bad results if they paste in raw code without trying to format it as code. There is no way to work around this, no magical AI that can “detect” code and format it for the user.
Two ways:
-
Use the
```triple backticks at the top and bottom to mark a code block -
Select the code then press ctrl+k (or use the
toolbar button) to indent it all by four spaces