De-duplicated TemplateStyles are missing when editing a section in visual section editing.
Steps to reproduce:
- Visit https://wikitech.wikimedia.org/wiki/Deployments
- Edit any section other than the first one
The templates (used to render each section) look differently than in read mode. It turns out that this is because when a template is used multiple times, its TemplateStyles are only attached to the first occurrence, and in this case that occurrence is in a hidden section.
After making any changes to a template, the expected styles appear for all templates: