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?

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.

This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...