Page MenuHomePhabricator

Merging of ParserOutput::getSections() / ::getTOCData() is not well defined
Open, Needs TriagePublic

Description

There is code which simply concatenates TOC HTML and appends SectionMetadata, but this is fundamentally broken because sections are expected to be globally numbered. Blindly merging section metadata will yield two "section 1", eg.

In order to make this work for fragments, the global numbering either needs to be hoisted out of SectionMetadata and recomputed after the merge, or else we need to re-run the global numbering steps when merging section metadata.