Code Formatting for the Forum
-
Now we have a javascript actor can we have an option for submitting code in forum posts please?
You've probably seen this in other forums - it would make any scripts look tidy and easier to copy and paste. -
Good idea!
-
Yeah, I just saw your JS post @gavspav its needed.
-
Great idea!
-
Added pretty print. You can now add <code></code> and <pre></pre> tags. Though you have to switch to "show rich text" if you add the tags.
function main()
{
var arr = []
while(arr.length < 4){
var randomnumber=Math.ceil(Math.random()*15)
var found=false;
for(var i=0;i<arr.length;i++){ if(arr[i]="=randomnumber){found=true;break}" }="" if(!found)arr[arr.length]="randomnumber;" return[arr[0],arr[1],arr[2],arr[3]]="" <="" code=""></arr.length;i++){>
-
Tried it but I can't get my head around it!
Is there an icon I can press or something? Hate Html! -
Just a quick test, with prettyprint class
Using Code tag:
function main(){ return arguments[0] + 1; }
Using Pre tag:
function main(){ return arguments[0] + 1; }
Just a quick test without prettyprint class.
Using Code tag:
function main(){ return arguments[0] + 1; }
Using Pre tag:
function main(){ return arguments[0] + 1; }
-
I was just posting to say I still don't understand how to do this but I think I've got it now.
You have to click the 'show source' icon which sometimes becomes the 'show rich text' icon?I'm just going to try it now
If that's alright with you guys