Last modified: 2008-09-28 15:32:17 UTC
Please Add the enclose type "none". so that syntax can highlighted inline. My revision: 37495 Patch: --- SyntaxHighlight_GeSHi.class.php.org 2008-08-18 10:25:21.00 +++ SyntaxHighlight_GeSHi.class.php 2008-09-18 14:32:20.000000000 +0200 @@ -35,9 +35,11 @@ if( !$geshi instanceof GeSHi ) return self::formatError( htmlspecialchars( wfMsgForContent( 'syntaxhighlight-err-lang // "Enclose" parameter - $enclose = isset( $args['enclose'] ) && $args['enclose'] == 'div' - ? GESHI_HEADER_DIV - : GESHI_HEADER_PRE; + $enclose = GESHI_HEADER_PRE; + if (isset( $args['enclose']) ) { + if ( $args['enclose'] == 'div' ) { $enclose = GESHI_HEADER_DIV; } + if ( $args['enclose'] == 'none' ) { $enclose = GESHI_HEADER_NONE; } + } // Line numbers? if( isset( $args['line'] ) ) { // Force <div> mode to maintain valid XHTML, see @@ -85,7 +87,12 @@ $out = str_replace( "\n", '', $out ); // Register CSS $parser->mOutput->addHeadItem( self::buildHeadItem( $geshi ), "source-{$lang}" ); - return '<div dir="ltr" style="text-align: left;">' . $out . '</div>'; + if ( $enclose == GESHI_HEADER_NONE ) { + return '<span class="'.$lang.' source-'.$lang.'"> '.$out . '</span>'; + } else { + return '<div dir="ltr" style="text-align: left;">' . $out . '</div>'; + } + } }
Can you post the patch as an attachment please? Are the parameters the extension accepts documented anywhere? They should probably be updated too (or written, but that is out of scope of this bug)
Created attachment 5346 [details] Patchfile for inline Highlighting for revision 37495
Patch does not apply to latest version in trunk. I've cleaned up the enclosure code somewhere in the middle. Can you provide a patch against the latest version? I can try to port the patch later if I have time.
Created attachment 5360 [details] Patch for the last revision: 37495
Added with some modifications in r41349.