Author: stanley
Description:
Please allow <source> tag to be stylized using HTML attributes
Version: unspecified
Severity: enhancement
• bzimport | |
May 31 2007, 7:52 AM |
F4174: bug10081.patch | |
Nov 21 2014, 9:52 PM |
Author: stanley
Description:
Please allow <source> tag to be stylized using HTML attributes
Version: unspecified
Severity: enhancement
sexyeuroboy wrote:
Any traction on this? Reasonably simple request for a simple gain.
Created attachment 7751
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.
Attached:
a.d.bergi wrote:
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?
a.d.bergi wrote:
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)
a.d.bergi wrote:
if ( $enclose === GESHI_HEADER_NONE ) {
$attribs = self::addAttribute( $attribs, 'class', 'mw-geshi ' . $lang . ' source-' . $lang );
} else {
+ $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';