File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -412,19 +412,19 @@ function deduplicateMentions(paragraph: string) {
412
412
}
413
413
414
414
// Extract mentions from the match groups
415
- let mentions = matches . slice ( 1 ) . filter ( Boolean ) as string [ ] ;
415
+ let mentions = matches . slice ( 0 , 1 ) [ 0 ] . trim ( ) . split ( ' ' )
416
416
417
417
// Deduplicate mentions
418
418
mentions = [ ...new Set ( mentions ) ] ;
419
419
420
420
// Reconstruct the string with deduplicated mentions
421
- const uniqueMentionsString = `@ ${ mentions . join ( ' ' ) } ` ;
421
+ const uniqueMentionsString = mentions . join ( ' ' ) ;
422
422
423
423
// Find where the mentions end in the original string
424
424
const endOfMentions = paragraph . indexOf ( matches [ 0 ] ) + matches [ 0 ] . length ;
425
425
426
426
// Construct the result by combining unique mentions with the rest of the string
427
- return uniqueMentionsString + paragraph . slice ( endOfMentions ) ;
427
+ return uniqueMentionsString + ' ' + paragraph . slice ( endOfMentions ) ;
428
428
}
429
429
430
430
function restoreUrls (
@@ -454,4 +454,4 @@ function splitParagraph(paragraph: string, maxLength: number): string[] {
454
454
const restoredChunks = restoreUrls ( splittedChunks , placeholderMap ) ;
455
455
456
456
return restoredChunks ;
457
- }
457
+ }
You can’t perform that action at this time.
0 commit comments