mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-16 02:55:50 +00:00
Add mw-content-ltr/rtl class: fixes bug 33538: Line numbers are outside of left border when using <source ... line start= > on RTL wikis
Also make sure mw-content-ltr/rtl is the same as the dir attribute value. Restrict that value to either ltr or rtl (not sure if rtl really needed; source code is always ltr). Also remove text-align:left; as it can/should be set manually in the <source> tag.
This commit is contained in:
parent
beba10969a
commit
b81f422ffc
|
@ -117,12 +117,9 @@ class SyntaxHighlight_GeSHi {
|
|||
if ( $enclose === GESHI_HEADER_NONE ) {
|
||||
$attribs = self::addAttribute( $attribs, 'class', 'mw-geshi ' . $lang . ' source-' . $lang );
|
||||
} else {
|
||||
if ( !isset( $attribs['dir'] ) ) {
|
||||
$attribs = self::addAttribute( $attribs, 'dir', 'ltr' );
|
||||
}
|
||||
|
||||
$attribs = self::addAttribute( $attribs, 'class', 'mw-geshi' );
|
||||
$attribs = self::addAttribute( $attribs, 'style', 'text-align: left;' );
|
||||
// Default dir="ltr" (but allow dir="rtl", although unsure if needed)
|
||||
$attribs['dir'] = isset( $attribs['dir'] ) && $attribs['dir'] === 'rtl' ? 'rtl' : 'ltr';
|
||||
$attribs = self::addAttribute( $attribs, 'class', 'mw-geshi mw-content-' . $attribs['dir'] );
|
||||
}
|
||||
$out = Xml::tags( $encloseTag, $attribs, $out );
|
||||
|
||||
|
|
Loading…
Reference in a new issue