Including javascript code in forum posts

Nov 7, 2011 at 12:57am

Including javascript code in forum posts

It looks like the click-to-expand method of pasting in copy-compressed max patches breaks when you try to include anything else wrapped in code tags. I really love the feature but is there any way to preserve whitespace properly when posting other code snippets, like javascript, to the forum?

#59858
Nov 7, 2011 at 12:00pm

I would just post a patch with a comment displaying the js-code.

(I’ve always been curious to why nobody shares their email on the forum this way)

#215469
Nov 11, 2011 at 11:15am

Good idea, I’m not sure why I didn’t think of that, the [js] object is even clever enough to keep the indentation, even if [comment] does not display it!

#215470
Nov 11, 2011 at 4:11pm

You can use the pre tag to preserve formatting:

function test() {
	this is
	my
			silly
			code
}
#215471

You must be logged in to reply to this topic.