mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-11-11 17:02:05 +00:00
feat: wrap tab content in <p> if there are no HTML elements
This commit is contained in:
parent
c06f0e7e74
commit
a3212b6c2b
|
@ -98,7 +98,12 @@ class Tabber {
|
|||
|
||||
// Use language converter to get variant title and also escape html
|
||||
$tabName = $parser->getTargetLanguageConverter()->convertHtml( trim( $tabName ) );
|
||||
$tabBody = $parser->recursiveTagParse( $tabBody, $frame );
|
||||
$tabBody = $parser->recursiveTagParse( trim( $tabBody ), $frame );
|
||||
|
||||
// If $tabBody does not have any HTML element (i.e. just a text node), wrap it in <p/>
|
||||
if ( substr( $tabBody, 0, 1 ) !== '<' ) {
|
||||
$tabBody = '<p>' . $tabBody . '</p>';
|
||||
}
|
||||
|
||||
$tab = '<article class="tabber__panel" data-title="' . $tabName .
|
||||
'">' . $tabBody . '</article>';
|
||||
|
|
Loading…
Reference in a new issue