Yeah, we're building a COBOL advocacy TikiWiki site. The CODE plugin removes leading indentation. FIXED format COBOL uses a 6 character sequence number, column 7 as a special indicator and actual code starting at column 8. The initial $code = trim($data); is inappropriate for COBOL, and perhaps for other snippets that need to be cut'n'pasted with indentation intact.
I'd almost just go ahead and commit the change, but I'm not experienced enough with the technical details of PHP, and worry that the solution I'm using locally is not an unacceptable performance hit or that using the > v4.1 charlist feature of the trimming functions breaks legacy Tiki installations. I doubt it, but I thought I'd start here and get expert opinions.
function wikiplugin_code($data, $params) { if ( is_array($params) ) { extract($params, EXTR_SKIP); } $code = trim($data); $parse_wiki = ( isset($wiki) && $wiki == 1 ); // Detect if GeSHI (Generic Syntax Highlighter) is available
All that is required is changing trim($data); to rtrim$data, "\n\r\0\x0B"; so that leading spaces and tabs (tabs, they should be removed ... just because ... but that's not playing nice with others) are left intact.
We're using GeSHi, but this trim occurs regardless.
Thanks for listening,
Brian
A simple workaround for now, is to use an initial sequence number
000000 >>SOURCE FORMAT IS FIXED, but it will be better to leave initial spaces in place.
function wikiplugin_code($data, $params) { if ( is_array($params) ) { extract($params, EXTR_SKIP); } $code = rtrim(ltrim($data, "\n\r\0\x0B")); $parse_wiki = ( isset($wiki) && $wiki == 1 ); // Detect if GeSHI (Generic Syntax Highlighter) is available
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |