In content builder when saving a code resource server side code is getting removed
Trailblazer Community

In content builder when saving a code resource server side code is getting removed

Marketing Cloud Automations

Last updated 24 days ago ·Reference W-10785107 ·Reported By 34 users

In Review

Summary
When saving a code resource with a script tag that uses single quotes around 'runat=server' the Content Builder sanitizer will strip the entire tag block. Example

<script runat='server' language='javascript'>
// this is a script
</script>

Repro
1. Create a new javascript CodeResource in CloudPages application
2. Add the code block above with the single quotes
3. Save the asset and exit back to collections
4. Open code resource again

Workaround
Double quotes or no quotes work fine example:
<script runat="server" language="javascript">
// this is a script
</script>

Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.