It was escaped in the line above then added to the anchor element's href attribute and inner HTML in the following line. Changed to an inline esc_url and esc_html.