BBCode for [code]? (Features)
That's interesting but it replaces indentations by something like " ". Actually <pre> is here more appropriate (one of the advantages of the BBCode class is better HTML output). How about two types of bbcodes: [ code] and [codeblock]? Maybe a little bit confusing?
see source code comments:
1) Replace 2 spaces with " " so non-tabbed code indents without making huge long lines.
2) Replace tabs with " " so tabbed code indents sorta right without making huge long lines.
This was taken directly from phpBB and could be omitted, if you don't want it.
I just downloaded phpBB to see how they've solved that. Ideed they don't use <pre> (not even <code> ) but nevertheless inline code isn't possible:
Did you read my PHP source code? It has a line: code lifted from phpBB 2.0.20's file 'includes/bbcode.php' at http://www.phpbb.com/