For [[ https://www.mediawiki.org/wiki/Manual:Collapsible_elements | collapsible elements ]], there is no space in the markup, between the dynamically generated element `span.mw-collapsible-toggle` and the preceding content.
{F5290939,size=full}
This is fine in most situations, because this toggle element has a CSS float by default.
But in some situations, e.g. in table captions, this CSS float is undone. In such case, the toggle element is right next to its preceding content, without spacing.
Demo:
```
{| class="mw-collapsible wikitable" style="width:50%"
|+ caption
! header
|-
| content
|}
```
Possible fix: add the following line in [[ https://phabricator.wikimedia.org/diffusion/MW/browse/master/resources/src/jquery/jquery.makeCollapsible.js | jquery.makeCollapsible.js ]]:
```
buildDefaultToggleLink = function () {
return $( '<a>' )
.attr( {
role: 'button',
tabindex: 0
} )
.text( collapseText )
.wrap( '<span class="mw-collapsible-toggle"></span>' )
.parent()
+++ .before(' ')
.prepend( '<span class="mw-collapsible-bracket">[</span>' )
.append( '<span class="mw-collapsible-bracket">]</span>' )
.on( 'click.mw-collapsible keypress.mw-collapsible', actionHandler );
};
```