How do I include code in my instructable and not have it autoformatted?
6
answers
|
Answer it!
|
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.
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.
L
Are you using the triple curly brackets?
{{{
test code 1 2 3
}}}
perhaps with the new version of the text editor they broke it... :(
![]() |

































