Используя jQuery, вы можете просто использовать следующий код, который не будет конфликтовать ни с какими другими тегами:
// Create an anchor tag pointing to the required URL if needed having the .link contents
const anchorTag = $('<a>').attr('href', 'http://EXAMPLE.com').html( $('p > .link').html() );
//Getting The direct plain text of "p" tag
const pText = $('p > .link').closest('p')
.clone() //clone the element
.children() //select all children
.remove() //remove all children
.end() // back to the selected element
.text(); //Gets the direct "p" tag text
//Replace the "p" tag contents
$('p > .link').closest('p').html(pText).append(anchorTag);
Благодаря «Delgan» за подход к получению прямого простого текста любого тега можно найтина эту ссылку