Table of Contents does not generate correctly when styles are in a table
I ran into an issue with generating a Table of Contents when the Paragraph Styles it's told to look for are in the header rows of tables.
In my stripped down example of this bug, I have a series of Tables with header rows that have the Paragraph Style I set the Table of Contents to look for. It seems depending on if the table overflows and must continue on the next page, it won't always show up in the Table of Contents and it will get skipped over.
So in my example, Table 1 begins on Page 2 and continues onto page 3. Table 2 begins on Page 3 and continues onto Page 4, but is skipped in the Table of Contents. But Table 3 does appear in the Table of Contents, despite appearing to be in a similar situation as Table 2. With the only difference being it has an extra, unnecessary paragraph break between tables.
The issue seems to be if a Table header contains a Paragraph Style that the Table of Contents is looking for and that Table breaks across pages, then an extra paragraph break is needed between the two Tables, otherwise it won't get picked up by the Table of Contents. However, if two tables start and end on the same page, then the extra paragraph break isn't necessary.
This doesn't seem right.