Login
Remember
IF Answers
Ask a Question

# How do I use code formatting in posts on IF Answers?

+1 vote
86 views
asked Mar 26 in Meta by mattweiner (121 points)
recategorized Mar 27 by Alex

I have had not entirely an easy time figuring out how to format code properly in IFAnswers. I copied some code from the intfiction forum and it was automatically formatted as code, which was great, but then I couldn't figure out how to type anything that wasn't code after that and not have it formatted as code.

Eventually I typed some paragraph breaks in my non-code-formatted stuff and copy-pasted that whenever I needed to start a new paragraph that wasn't formatted as code, but that was less than ideal. Is there a simple HTMLish tag I can use for code formatting when typing a question/answer?

- meta
- formatting

commented Mar 26 by Dannii (329 points)
I haven't figured that out, however we will probably be changing the editor soon. Hopefully the new one will be much easier for code.
commented Mar 26 by AndrewS (250 points)
I guess a temporary workaround could be to use the "formatted" option in the text. The pull-down box that says "normal" could be changed. "Formatted" is the bottom option for me, and it has fixed-width code, which is different enough that people will be able to tell it's code.

## 1 Answer

+2 votes
answered Mar 29 by bg (692 points)
edited Mar 29 by bg

They've changed the editor, so you can now use the { } button for code. The code indentation seems to be preserved best if I first paste in the code, then highlight it and press the { } button, rather than starting with the { } button and then pasting in the code.

Trying to use bullets in the same post seems to throw off the code formatting, though. I haven't been able to figure out a way to make both bullets and code display correctly in the same post.

## Related questions

- On IF Answers, should comments be hidden after edits are made to a question or answer?
- On IF Answers, should the question itself mention the development system?
- How can I find out in ifanswers if my question is answered?
- What is IF Answers?
- Do questions on a development tool need to mention the version?

...