JSFiddle - React, Tailwind, and code Playground

JavaScript

var comment = "this is my comment with <a href='http://google.com'>http://google.com</a> link";

function convertLinkEdit(text) {
    var dummy = document.createElement('p');
    dummy.innerHTML = text;
    return dummy.textContent || dummy.innerText;
}


alert(convertLinkEdit(comment));