// If this is not a custom case, do the default: wrap the
// contents and add the toggle link. Different elements are
// treated differently.
+
if ( $collapsible.is( 'table' ) ) {
// If the table has a caption, collapse to the caption
}
}
+ } else if ( $collapsible.parent().is( 'li' ) &&
+ $collapsible.parent().children( '.mw-collapsible' ).size() === 1
+ ) {
+ // special case of one collapsible in <li> tag
+ $toggleLink = buildDefaultToggleLink();
+ $collapsible.before( $toggleLink );
} else if ( $collapsible.is( 'ul' ) || $collapsible.is( 'ol' ) ) {
// The toggle-link will be in the first list-item
$firstItem = $collapsible.find( 'li:first' );