Skip to content

Commit

Permalink
Expand comment [skip ci].
Browse files Browse the repository at this point in the history
  • Loading branch information
Dumluregn committed Feb 20, 2024
1 parent 99c2876 commit e54a9c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ckeditor5-mention/src/mentioncommand.ts
Expand Up @@ -191,7 +191,9 @@ export default class MentionCommand extends Command {
isInsertedInBrackets = isPrecededByOpeningBracket && isFollowedByBracketClosure;
}

// Don't add a white space if there's already one after the mention or if the mention was inserted in brackets.
// Don't add a white space if either of the following is true:
// * there's already one after the mention;
// * the mention was inserted in the empty matching brackets.
// https://github.com/ckeditor/ckeditor5/issues/4651
if ( !isInsertedInBrackets && !isFollowedByWhiteSpace ) {
model.insertContent( writer.createText( ' ', currentAttributes ), range!.start.getShiftedBy( mentionText.length ) );
Expand Down

0 comments on commit e54a9c8

Please sign in to comment.