Last modified: 2014-08-08 22:11:08 UTC
To reproduce go to any page with collapsible content, e.g. https://en.wikipedia.org/wiki/Help:Table#Using_class_mw-collapsible Execute in the console: $clone = $('#bodyContent').clone(); mw.hook('wikipage.content').fire($clone); $('#bodyContent').replaceWith($clone); The collapsible content is now no longer collapsible (but at least sortable tables are still sortable). Note that it doesn't work with the following code, either (and this breaks sortable tables, too: bug 38704): $clone = $('#bodyContent').clone(true); $('#bodyContent').replaceWith($clone); What I'm currently doing (in a script that shows footnotes in a popup and should be able to show collapsible and sortable tables as such) is an additional $clone.find('.mw-collapsible-toggle').remove(); between the first and second line, but this is more a hack than a solution: $clone = $('#bodyContent').clone(); $clone.find('.mw-collapsible-toggle').remove(); mw.hook('wikipage.content').fire($clone); $('#bodyContent').replaceWith($clone); This is probably easily fixable: The cloned handles are recognized as such, but when the user clicks on them the content isn't collapsed/expanded, because they are links. If the pass-through behavior wasn't applied to links with href="#", the cloned contents will probably be collapsible without hacks.
Hmm, yeah. The proposed fix looks reasonable to me. This would be a slightly hacky workaround, but it shouldn't cause any problems. Perhaps a better long-term solution would be to make the toggles actual buttons, but we can think about that some other time. (Nitpick correction: the collapsibility still works, but you need to click on one of the brackets '[]', and not on the link itself.)