Enable headings in body text on document collections to appear in contents section #3507
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow these steps if you are doing a Rails upgrade.
What
Investigate whether we can enable headings in the body text to be included in the contents section, and if possible make it happen.
Why
The 'Contents' section of a document collection page is created automatically from the 'groups' of documents on the page. That works fine the majority of the time.
However, sometimes departments need to also link to documents or webpages that are relevant, but hosted off GOV.UK.
Because Whitehall doesn't let them add such links off the GOV.UK domain to 'groups', they have to add these to the body content of a page in the conventional way, under headings.
However, the H2s in the body content of a collection page are not made part of the 'Contents' list. This means that the contents list doesn't properly reflect the structure of the webpage.
Having the contents list reflect all of the page's H2s would make the collection page template consistent with detailed guides and publications.
Examples
Trello card