How to use Liquid syntax to dynamically generate multiple email buttons? It leads to 404 error on Wikipedia

I am learning to use Liquid to dynamically enhance my email buttons…

I discovered that I could use the for loop included in Liquid’s documentation to successfully generate multiple buttons in an email based on how many links are included in a comma separated list saved in a custom field…

When there is only data for one link present, it will run the [% else %] segment, and that successfully generates an email button with proper link tracking, producing this…

However, when there is data for multiple links in the custom field, it runs the [% for link in links %] segment, and successfully generates multiple buttons, however the links generated by the for loop incorrectly lead to 404 on Wikipedia, seemingly related to this issue?

I suspect this is because Infusionsoft generates unique link tracking for each button in the builder, but this seems to be broken when the buttons are generated by a for loop. Any ideas on how to fix?

Discovered the solution! I found that the URL field is a different call stack, so it will not remember processes leading up to the point of whatever is included in the URL field.

To solve, you have to restart the Liquid code block from the beginning in order for button links to support liquid code within the URL field.