diff --git a/packages/js/email-editor/src/components/personalization-tags/rich-text-utils.ts b/packages/js/email-editor/src/components/personalization-tags/rich-text-utils.ts index 2a4f42d95d..883cc6cc32 100644 --- a/packages/js/email-editor/src/components/personalization-tags/rich-text-utils.ts +++ b/packages/js/email-editor/src/components/personalization-tags/rich-text-utils.ts @@ -117,7 +117,7 @@ const getCursorPosition = ( ); if ( formatIndex !== null ) { return { - start: formatIndex + selection.anchorOffset, + start: formatIndex + selection.anchorOffset + 1, // We need to add 1 for the format length end: formatIndex + selection.anchorOffset + range.toString().length, }; } @@ -129,7 +129,7 @@ const getCursorPosition = ( ); if ( replacementIndex !== null ) { return { - start: replacementIndex + selection.anchorOffset, + start: replacementIndex + selection.anchorOffset + 1, // We need to add 1 for the replacement length end: replacementIndex + selection.anchorOffset +