Posting formatted code

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.

Steve

sort by: active | newest | oldest
pber2 years ago

Yes Pasting Formatted code is awful on Instructables.

It puts everything on one line.

Please fix.

pseaton2 years ago

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:

https://www.instructables.com/id/Instructables-Univ...

Is that helpful?

Best,
Phil

steveastrouk (author)  pseaton2 years ago

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

Steve

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

steveastrouk (author)  Brooklyntonia2 years ago

Why break a system that worked really well ?

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.

steveastrouk (author)  kelseymh2 years ago

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 :)