added escaping support for template blocks