You shouldn’t be putting arbitrary HTML into post content, instead use shortcodes! Shortcodes were intended for this situation.
Otherwise you face 2 problems:
- Filters will escape your content via the
wp_kses_post
on output - TinyMCE will filter/mangle/strip tags when you use the visual editor, even for the slightest of moments
All of these are done for security purposes, content should only contain content, not layout or UI. If you need those, use widgets, or put shortcodes inside your content.