I personally solved the problem in a snippet using the htmlspecialchars function
$link = '<a href="'.$program['content'].'" target="_blank">'.htmlspecialchars($program['pagetitle']).'</a>';
Probably the easiest solution is to create a PHx custom modifier called htmlspecialchars.
Here’s the untested code:
<?php
$string=$output;
return htmlspecialchars($string);
?>
If you have PHx installed you should create a snippet called "phx: htmlspecialchars" with the above code
In your template or chunk use [*pagetitle: htmlspecialchars*]
Let me know if it works