How: [code][/code] wrappers can be quickly inserted by clicking the
# icon. Click once to insert the start wrapper and click again to insert the end wrapper. Or select the code and click the icon to wrap the entire selected text at once. You can of course insert the wrappers manually too.
Why:- They prevent smiley insertion.
- They leave text formatting such as indents alone, making the code more readable/manageable.
- They clearly outline code in contrast to other text.
- They keep the post size down by adding scrollbars to the codebox when needed.
- They make it somewhat easier to copy the code from the page.
- vB code such as [B][/B], [I][/I] and [COLOR=Red][/COLOR] still work. -Does not apply to highligt wrappers
- And some other things I don't remember now...
There is also the [PHP][/PHP] wrapper which includes a syntax highlighter for PHP code, but I don't recommend using it for JavaScript since the highligher can misinterpret it.
UPDATE:
We now have the
[highlight=language] [/highlight] wrapper which basically works like the code wrapper, but it also adds syntax highlighting. There's no need to use the code wrapper if using the highlight wrapper.
Announcement about available languages.