Since https://gerrit.wikimedia.org/r/101470 hiding of toc in live preview doesn't work anymore, because the hook is fired when the content is detached and the toc hiding code search on the attached content.
Reproduced in Mozilla Firefox and Google Chrome.
Solution: Use $content of the hook
Version: 1.23.0
Severity: normal