Removes links from text.

@param {string} text The text string to analyze.

@returns {string} The text with links stripped away.
function removeLinksFromText( text ) {
	const anchors = getAnchorsFromText( text );
	if ( anchors.length > 0 ) {
		anchors.forEach( function( anchor ) {
			text = text.replace( anchor, "" );
		} );
	}

	return text;
}