Follow-up ee320648fd: output mw-content-{ltr,rtl} unconditionally
So much CSS relies on .mw-content-{ltr,rtl} now for directionality
things that we should just have it everywhere.
Bug: T97744
Change-Id: I0c0466023bc3b88d58f7067c3226f2dbdd1488ed
This commit is contained in:
parent
ee320648fd
commit
143c81451e
1 changed files with 5 additions and 9 deletions
|
|
@ -421,15 +421,11 @@ class SkinTemplate extends Skin {
|
|||
$realBodyAttribs = array( 'id' => 'mw-content-text' );
|
||||
|
||||
# Add a mw-content-ltr/rtl class to be able to style based on text direction
|
||||
# when the content is different from the UI language, i.e.:
|
||||
# not for special pages or file pages AND only when viewing
|
||||
if ( !in_array( $title->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) &&
|
||||
Action::getActionName( $this ) === 'view' ) {
|
||||
$pageLang = $title->getPageViewLanguage();
|
||||
$realBodyAttribs['lang'] = $pageLang->getHtmlCode();
|
||||
$realBodyAttribs['dir'] = $pageLang->getDir();
|
||||
$realBodyAttribs['class'] = 'mw-content-' . $pageLang->getDir();
|
||||
}
|
||||
# when the content is different from the UI language
|
||||
$pageLang = $title->getPageViewLanguage();
|
||||
$realBodyAttribs['lang'] = $pageLang->getHtmlCode();
|
||||
$realBodyAttribs['dir'] = $pageLang->getDir();
|
||||
$realBodyAttribs['class'] = 'mw-content-' . $pageLang->getDir();
|
||||
|
||||
$out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext );
|
||||
$tpl->setRef( 'bodytext', $out->mBodytext );
|
||||
|
|
|
|||
Loading…
Reference in a new issue