Author Options:

Posting formatted code Answered

How do I post properly formatted code with the new editor ? The old one accepted Arduino format cut/paste, the new one mangles it completely.




2 years ago

Yes Pasting Formatted code is awful on Instructables.

It puts everything on one line.

Please fix.

Hi Steve,

If you're a pro member you should see a "Code" option in the editor under "formatting" that allows you to select some text to display it monospaced inside a reasonable-sized box on Instructables pages. No line numbers or syntax highlighting, but definitely more readable for code. That's what I did here:


Is that helpful?


Ah, Not here, and not in the answers section. Nice try though....


Could you not just attach a text document with the code properly formatted? Why does it need to be in the step description?

Because that makes it really hard to refer to bits of the code in the step descriptions. Imagine if you could only attach links to all the images, and users had to download each one and view it externally. Same thing.

Absolutely, and you'd lose the ability to make comments on the code in the answers. Can you imagine ?

Look at line 28, it needs to be.....

And at line 118, there's a spelling mistake in the third word.

If you find out let me know!
I tried different ways to embed code without it being altered, mangled, messed up or interpreted as code for the text you are writing.
A dedicated code box that allows to paste text as it is would be a good addition.
Let's just hope our code monkeys are reading it and find a fix for it :)