3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How do I include code in my instructable and not have it autoformatted?

I have included code in my instructables before using the Trac wiki markup.  Now when I revisit those pages my code is unreadable as either a block of text or just one line that scrolls out to infinity.  How do I fix this so that my included code actually looks good.

6 answers
sort by: active | newest | oldest
Oct 29, 2009. 11:55 AMkelseymh says:

Since you have a paid ("PRO") account, you can do this with the <PRE> HTML tag. Click the Source button and paste your code in between <PRE> and </PRE>. Here's an example:

  The text seen here is in fixed format, sort of like source code. 

Hit the Source button again to go back to WYSIWYG text entry. Make sure, though, that you leave your cursor outside the PRE block! Otherwise you'll have some weird and unexpected behaviour.

Oct 29, 2009. 1:25 PMkelseymh says:
That is interesting, and is definitely a bug!

I had put the preformatted text above on three separate lines, with carriage returns.  The "preview" and the "WYSIWIG" version of the text-entry box correctly showed three lines.  However, the processing and storage of the comment stripped those carriage returns, leaving the single line you see above.
Oct 29, 2009. 12:12 PMlemonie says:
None of your instructables look corrupted to me (today). If it was right and the site stuffed-it-up that's a site bug and not something you should have to fix yourself.

L
Oct 29, 2009. 9:32 AMfrollard says:
http://www.instructables.com/id/SNW9LDVF9MGKZHE/

Are you using the triple curly brackets?

{{{ 
test code 1 2 3 
}}}

perhaps with the new version of the text editor they broke it... :(

Oct 29, 2009. 11:56 AMkelseymh says:
Those curly brackets were part of the old "pseudo-Wiki" formatting markup, and are no longer valid.  It's not "broken," its an entirely different back-end software package.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!