Your actual problem is trying to use inline JS, which is prohibited by CSP.
Put this code in a helper function in your theme component code, and do not inject it inside posts.
Uploading your current theme to GitHub and we can take a look too.
Your actual problem is trying to use inline JS, which is prohibited by CSP.
Put this code in a helper function in your theme component code, and do not inject it inside posts.
Uploading your current theme to GitHub and we can take a look too.