(Legacy Email builder) mautic 5 adds unexpected and copies &amp styling multiple times code when saving HTML part of email Your bug title goes here!

Your software
My Mautic version is: 5.0.3
My PHP version is: 8.1.27
10.3.38-MariaDB

Your problem
The classic email builder adds and repeats unexpected code especialy &amp in the email every time it is saved (or cloned), which grows to the point that the email saving can crash with a JavaScript error and e-mail size will extend very hard with this evertime.

It happens with the blank template but also with own / or custom templates.

How can we reproduce this issue?

Step 1: Create a new email with the legacy builder.
Step 2: Choose the default Blank or another template.
Step 3: Modify something and save the email.
Step 4: After saving the email check what was saved in: ##__emails table to the field custom_html
Step 5: The content of the field custom_html save for the future compare.
Step 6: Open the email with Builder, modify something and save again.
Step 7: After full saving the email check what was saved the the ##__emails table to the field custom_html and compare with previous state of the data

Relevant log output


See also on Github: (Legacy Email builder) mautic 5 adds unexpected and copies &amp styling multiple times code when saving HTML part of email Your bug title goes here! · Issue #13452 · mautic/mautic · GitHub