@humptydumpty You cannot imagine how many hours I lost to fix that problem. I was embedding an iframe from Calendly and I discovered issue.
But solution... no solution on the web, only with variuos workarounds, jumps, plugins, fixes on functions.php, and so on...
Casually, the same day I had another issue to solve: Wordpress "file editor" was disappeared from admin menu. I googled how to put editor back again. Solution was to change some value in wp-config.php (
define( 'DISALLOW_FILE_EDIT', true ) to false).
When I put hands in wp-config.php changing that value to enable again file editor, just a row after my eyes fell on
define( 'DISALLOW_UNFILTERED_HTML', true );... and there I understood that it could be the reason for the "cleaning" of the code.
Like you, at beginning I could not explain this problem, I thought it was due to the latest Wordpress release and instead it was due to that value
define( 'DISALLOW_UNFILTERED_HTML', true );.
Just a note: they were all fresh Wordpress install from Cloudron. I think the script adds that new rows to wp-config.php that before it does not add.