parser

🧩 Syntax:
function parser(txt){
        regex = [txt.matchAll(/\[([^\]]+)\]\(([^)]+)\)/g),/(https?:\/\/[^\s]+)/g]
        for (const match of regex[0]) {
            if(!regex[1].test(match[2].trim())){url=`https://${match[2].trim()}`}else{url = match[2].trim()}
          	txt = txt.replace(match[0],`<a href='javascript:if(confirm("do you trust the website: ${url}?")){window.open(url)}'>${match[1].trim()}</a>`)
        }
        return txt
}