mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-11-27 17:50:55 +00:00
feat: add langauge converter support
This should allow MW apply langauge conversion to tab title
This commit is contained in:
parent
365777eae3
commit
874738db2a
|
@ -87,10 +87,11 @@ class Tabber {
|
|||
// Use array_pad to make sure at least 2 array values are always returned
|
||||
list( $tabName, $tabBody ) = array_pad( explode( '=', $tab, 2 ), 2, '' );
|
||||
|
||||
$tabName = trim( $tabName );
|
||||
// Use language converter to get variant title and also escape html
|
||||
$tabName = $parser->getTargetLanguageConverter()->convertHtml( trim( $tabName ) );
|
||||
$tabBody = $parser->recursiveTagParse( $tabBody, $frame );
|
||||
|
||||
$tab = '<article class="tabber__panel" data-title="' . htmlspecialchars( $tabName ) .
|
||||
$tab = '<article class="tabber__panel" data-title="' . $tabName .
|
||||
'">' . $tabBody . '</article>';
|
||||
|
||||
return $tab;
|
||||
|
|
|
@ -62,7 +62,8 @@ class TabberParsoid extends ExtensionTagHandler {
|
|||
// Use array_pad to make sure at least 2 array values are always returned
|
||||
list( $tabName, $tabBody ) = array_pad( explode( '=', $tab, 2 ), 2, '' );
|
||||
|
||||
$tabName = trim( $tabName );
|
||||
// Use language converter to get variant title and also escape html
|
||||
$tabName = $parser->getTargetLanguageConverter()->convertHtml( trim( $tabName ) );
|
||||
$tabBody = $extApi->domToHTML(
|
||||
$extApi->wikitextToDOM(
|
||||
$tabBody,
|
||||
|
@ -76,7 +77,7 @@ class TabberParsoid extends ExtensionTagHandler {
|
|||
)
|
||||
);
|
||||
|
||||
$tab = '<article class="tabber__panel" title="' . htmlspecialchars( $tabName ) .
|
||||
$tab = '<article class="tabber__panel" title="' . $tabName .
|
||||
'">' . $tabBody . '</article>';
|
||||
|
||||
return $tab;
|
||||
|
|
Loading…
Reference in a new issue