character styles in Table of Contents
Not sure if this is a bug or a feature.
It is a best practice, if you use running headers, to apply a character style to a selected subset of a heading, for example, HeadText1 for a first-level heading, and HeadText2 for a second-level heading, so that the header just shows basically a short title for the heading. You define the header to contain two text variables, first Heading1 that picks up, for example, the first instance of the text marked with HeadText1, and Heading2 that picks up the last instance of HeadText2. Works great, and I have a post at https://forums.adobe.com/thread/2602190 that shows how to do this. (HeadText1 and HeadText2 character styles apply nothing but the name, they don't change the text at all; they are just to tell the headers which subset of the Heading1 or Heading1 to put into the header at the top of the page.)
The problem is that when you generate a Table of Contents, the header will pick up HeadText2 and insert in the header, as the entries in the Table of Contents all have the HeadText1 and HeadText2 character styles. While keeping character styles is a good default… people might want to keep them in the Table of Contents… there should be a checkbox for "strip character styles" for documents where you are using this best practice for running headers.