Modified processPostContent to find headings in two locations:
1. Direct descendants of body (existing behavior)
2. Inside .wrap blocks (new - for email filtering via [wrap=no-email])
This allows table of contents to include headings that are wrapped for
email filtering purposes, which is a common use case in Discourse.
The headings are combined and sorted by document order to maintain proper
structure in the TOC.
As part of https://github.com/discourse/discourse/pull/36678, topic.tags now returns an array of tag objects ({ id, name, slug }) instead of an array of tag name strings.
The core change will break the auto_TOC_tags feature which was comparing the configured tag names against topic.tags using includes(), which no longer worked since it was comparing strings to objects.
This fix normalizes topic.tags to an array of tag names before comparison, maintaining backwards compatibility with both the old string format and the new object format.
* FEATURE: Allow TOC for replies
This commit adds an optional setting that allows enabling a TOC for
replies. TOCs for replies are not affected by autoTOC settings like
`auto_TOC_tags` and must be inserted manually.