@wordpress/block-library
Version:
Block library for the WordPress editor.
12 lines (11 loc) • 346 B
JavaScript
/**
* Removes anchor tags from a string.
*
* @param {string} value The value to remove anchor tags from.
*
* @return {string} The value with anchor tags removed.
*/
export default function removeAnchorTag( value ) {
// To do: Refactor this to use rich text's removeFormat instead.
return value.toString().replace( /<\/?a[^>]*>/g, '' );
}