Post HTML Element Class Being Removed

AFAIK whitelisting is for post content and is not involved with what is put into Admin → Customize

I am unfamiliar with the Mermaid (Flowchart) Plugin but my guess would be is that if you are having problems it is more likely a “onebox” issue.