Thread:Haldarn/@comment-193051-20180219192213

The other half of my plan to replace Item Header is now complete: I made a new script which wraps header sections and applies classes to the wrapper.

It works in a similar way to the collapsible header sections script, but is slightly more complex, using the span's attributes to specify the target and classes. To make things simple, I created WrapHeaderSection for the generic functionality and Item Sections for a simple include on item pages. I also created Collapse Sections as an easy way to include the collapsible header sections tag.

The script changes are still under review, so you might have to turn on test mode to see it, but I've added it to my sandbox: compare the [ new revision] to the [ old revision] (the difference is only apparent in Monobook, so I've specified that skin in those links).

I should note that while this functionality could be useful from time to time, it's better to explicitly wrap sections when possible. The biggest use case I see is to avoid a specific issue of section editing. Consider the following page markup:

Header 1
Content

Header 2
Other content Using the section edit feature on "Header 1" will show the following: Content An editor that doesn't understand what's going on might remove those div tags, thinking they're a mistake. We saw this happen a lot with the old item page formatting: novice editors would often remove the  at the bottom of a section and wreck the formatting. 