It depends on what you try to achieve with your other HTML content.
I crosspost a potential workaround: TOC doesn't work when wrapped with HTML tags - #2 by Canapin
It depends on what you try to achieve with your other HTML content.
I crosspost a potential workaround: TOC doesn't work when wrapped with HTML tags - #2 by Canapin