Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Community > Feedback > Please fix the code tag

Please fix the code tag
Thread Tools
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
May 6, 2007, 02:02 PM
 
Okay, for a while the [code] tag has been broken and shows up in the body of posts, like so:

Code:
#include <stdio.h> int main (int argc, const char * argv[]) { printf("Hello, World!\n"); return 0; }
thus leading many people, including myself, to assume that the [code] tag is broken. However, it turns out that there actually is a code tag, two of them in fact, but for some reason they are named [codeff] and [codex], and appear to do the exact same thing. However, they still remove all indentations, as you can see below:

Using [codeff]:
code:
#include <stdio.h>

int main (int argc, const char * argv[]) {
printf("Hello, World!\n");
return 0;
}


Using [codex]:
[codex]#include <stdio.h>

int main (int argc, const char * argv[]) {
printf("Hello, World!\n");
return 0;
}[/codex]

All the lines appear indented by exactly the same amount. This can make large code snippets confusing to read. In the old design, code snippets used to get a really nice little box that had horizontal scroll bars and everything. Please restore some of that functionality (and rename the tag to [code] again, as it was more intuitive). Thanks!

edit: there is one other problem with the code tags - they don't automatically turn off the vB code parsing for enclosed text. This can be a problem on a Mac-related discussion board, since HFS (including AppleScript, which uses HFS-style paths) and Objective-C are prominent on the Mac OS X platform, and both of them use colons quite frequently, which as a result can accidentally get converted into smilies. This can, of course, be worked around by encasing the [code] tags inside [noparse] tags, but it would be much nicer if this were done automatically.

examples:
code:
set thePath to "Macintosh HD:Users:meocuments:file.txt"

[codex]NSData *myData = [NSData dataWithContentsOfFileathToFile];[/codex]

Fixing these issues would make the forum much more friendly to technical discussions. Please give them your consideration.
( Last edited by CharlesS; May 6, 2007 at 02:18 PM. )

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
TETENAL
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
May 19, 2007, 05:20 AM
 
Seconded.
     
shifuimam
Addicted to MacNN
Join Date: Aug 2006
Location: The deep backwoods of the PNW
Status: Offline
Reply With Quote
May 20, 2007, 06:44 PM
 
Thirded. It took me like ten minutes just to find out how insert code in a post for my iBook mod project.
Sell or send me your vintage Mac things if you don't want them.
     
Thinine
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
May 21, 2007, 02:05 AM
 
Yes please.

Syntax hi lighting is optional, but recommended.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:43 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,