AMPscript directly after html tags is removed from content and can replace in-tag instances of other AMPscript
Trailblazer Community

AMPscript directly after html tags is removed from content and can replace in-tag instances of other AMPscript

Marketing Cloud Email Studio

Last updated 2018-05-24 ·Reference W-4710611 ·Reported By 3 users

No Fix

Summary
Browsers remove any content directly after the HTML tag when it parses it. Then, when replacing the original AMPscript in place, in-tag regex is used, which matches data-amp-placeholder-10 in the href, and puts the first AMPscript content there and leaves the 0.

Repro
1. Create a new email
2. Add an HTML block
3. Paste the following:
<html></html>%%test%%
%%test2%%
%%test3%%
%%test4%%
%%test5%%
%%test6%%
%%test7%%
%%test8%%
%%test9%%
<a href="%%test10%%">what???</a>
4. Close block
5. Reopen block

Workaround
Option 1:
Since HTML blocks aren't meant to have full HTML webpages in them and browsers will throw out the extra HTML tags, remove the HTML/body/head tags from the HTML block.

Option 2:
Create a dynamic content block first, and use a reference block to that dynamic content in the final email. Individual block parsing will not go through the same process of transforming the content through browser parsing.

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.