I think you should try to move this markup block into the template and use renderer to set the values as needed. It appears that you have the renderer setting the label to the string value, but then using a function to replace that with the markup here and setting a different element to have the string name.