diff --git a/blocks/autocompleters/index.js b/blocks/autocompleters/index.js index c3a0c5bacc199..d7e92a3e992fa 100644 --- a/blocks/autocompleters/index.js +++ b/blocks/autocompleters/index.js @@ -101,7 +101,7 @@ export function blockAutocompleter( { onReplace } ) { }; } /** - * Returns a "completer" definition for inserting links to the posts of a user. + * Returns a "completer" definition for inserting a user mention. * The definition can be understood by the Autocomplete component. * * @returns {Completer} Completer object used by the Autocomplete component. @@ -123,12 +123,12 @@ export function userAutocompleter() { } ); }; - const allowNode = ( textNode ) => { - return textNode.parentElement.closest( 'a' ) === null; + const allowNode = () => { + return true; }; const onSelect = ( user ) => { - return { '@' + user.name }; + return ( '@' + user.slug ); }; return {