Last modified: 2011-02-16 01:07:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 10081 - Allow html attribute on SyntaxHighlight GeSHi extension
Allow html attribute on SyntaxHighlight GeSHi extension
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SyntaxHighlight (GeSHi) (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: X!
: easy, patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-31 07:52 UTC by Borgx
Modified: 2011-02-16 01:07 UTC (History)
4 users (show)

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


Attachments
allow params for source-tags (1.58 KB, patch)
2010-10-23 19:15 UTC, Umherirrender
Details

Description Borgx 2007-05-31 07:52:33 UTC
Please allow <source> tag to be stylized using HTML attributes
Comment 1 Brion Vibber 2007-06-01 15:35:19 UTC
This would be pretty easy; see the Poem extension for an example of how to do this.
Comment 2 Chris Cunningham 2010-08-27 11:41:24 UTC
Any traction on this? Reasonably simple request for a simple gain.

 - Chris
Comment 3 Umherirrender 2010-10-23 19:15:51 UTC
Created attachment 7751 [details]
allow params for source-tags

I have create a patch, but I am not sure, if that the best way. Feel free to modify or create a new one.
Comment 4 Sam Reed (reedy) 2011-02-10 01:59:38 UTC
r81865
Comment 5 Bergi 2011-02-10 15:43:08 UTC
Nice, I just tested it at translatewiki.
Was it intended that the textalign an direction can be "overwritten"? textalign would be OK, but dir="rtl" results in dir="ltr rtl" which causes funny behavior at rtl-wikis.
Comment 6 Sam Reed (reedy) 2011-02-10 16:21:33 UTC
Hmm.

The dir=ltr is only set in one case. Is it worth just checking if it's not been set, and then only conditionally set it?
Comment 7 Bergi 2011-02-10 16:59:37 UTC
Are there any sources that can be rtl? I can't think of any programming languages, but theres still lang="text".
I think we can ignore that cases (we already did it in the past), so either 

> if( isset( $attribs[$name] && $name != 'dir') ) {
or better
> $attribs['dir'] = 'ltr';

could be changed. The other way, allowing a custom direction, could be provided by

> $attribs['dir'] = $attribs['dir'] || 'ltr';

(Ive got no SVN, sorry)
Comment 8 Sam Reed (reedy) 2011-02-10 17:17:35 UTC
Sorry, that's a bit hard to follow. Can you just write out the full code block?
Comment 9 Bergi 2011-02-10 17:52:02 UTC
> if ( $enclose === GESHI_HEADER_NONE ) {
> 	$attribs = self::addAttribute( $attribs, 'class', 'mw-geshi ' . $lang . ' source-' . $lang );
> } else {
- 	$attribs = self::addAttribute( $attribs, 'dir', 'ltr' );
+ 	$attribs['dir'] = $attribs['dir'] || 'ltr';
> 	$attribs = self::addAttribute( $attribs, 'class', 'mw-geshi' );
>	$attribs = self::addAttribute( $attribs, 'style', 'text-align: left;' );
> }

Im not sure whether PHP handles this automatic typecasting right, a more detailed version would be 
+ 	if ( is_null($attribs['dir']) ) $attribs['dir'] = 'ltr';
Comment 10 Sam Reed (reedy) 2011-02-11 00:28:30 UTC
if ( !isset( $attribs['dir'] ) ) {
	$attribs['dir'] = 'ltr';
}

I suppose...
Comment 11 Sam Reed (reedy) 2011-02-11 00:31:28 UTC
r81925

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


Navigation
Links