Last modified: 2011-02-16 01:07:14 UTC
Please allow <source> tag to be stylized using HTML attributes
This would be pretty easy; see the Poem extension for an example of how to do this.
Any traction on this? Reasonably simple request for a simple gain. - Chris
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.
r81865
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.
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?
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)
Sorry, that's a bit hard to follow. Can you just write out the full code block?
> 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';
if ( !isset( $attribs['dir'] ) ) { $attribs['dir'] = 'ltr'; } I suppose...
r81925