Last modified: 2008-09-28 15:32:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T17634, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15634 - Add The Enclosure/Header Type "none"
Add The Enclosure/Header Type "none"
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SyntaxHighlight (GeSHi) (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Niklas Laxström
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-18 13:02 UTC by Ric
Modified: 2008-09-28 15:32 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patchfile for inline Highlighting for revision 37495 (1.64 KB, patch)
2008-09-18 19:30 UTC, Ric
Details
Patch for the last revision: 37495 (2.29 KB, patch)
2008-09-23 10:57 UTC, Ric
Details

Description Ric 2008-09-18 13:02:47 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>';
+                       }
+
                }
        }
Comment 1 Niklas Laxström 2008-09-18 17:38:22 UTC
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)
Comment 2 Ric 2008-09-18 19:30:34 UTC
Created attachment 5346 [details]
Patchfile for inline Highlighting for revision 37495
Comment 3 Niklas Laxström 2008-09-21 16:53:52 UTC
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.
Comment 4 Ric 2008-09-23 10:57:54 UTC
Created attachment 5360 [details]
Patch for the last revision: 37495
Comment 5 Niklas Laxström 2008-09-28 15:32:17 UTC
Added with some modifications in r41349.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links