I think the real issue is here. You shouldn't really set that entire html block to a variable but instead have only:
And on the template:
<a href="{{ @testlink }}">
Which would ensure clear separation of data from presentation and allow you to change anything on the html code without touching other logic. MVC and all.
Is there any limiting reason why you're setting the variable to have the full html code?
EDIT: forgot to take the link's text in consideration. In that case use an array:
And on the template:
<a href="{{ @testlink.href }}">{{ @testlink.text }}</a>