Tengo este texto @abc some text here . ¿Cómo puedo convertirlo en <a href="some_url">@abc</a> some text here usando javascript? alguna biblioteca para hacer eso?
Use un reemplazo de expresiones regulares:
var input = "@abc some text here"; var output = input.replace(/(@\S+)/, "<a href=\"some_url\">$1</a>"); console.log(output);