File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 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) {
412412 }
413413
414414 // 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 ( ' ' )
416416
417417 // Deduplicate mentions
418418 mentions = [ ...new Set ( mentions ) ] ;
419419
420420 // Reconstruct the string with deduplicated mentions
421- const uniqueMentionsString = `@ ${ mentions . join ( ' ' ) } ` ;
421+ const uniqueMentionsString = mentions . join ( ' ' ) ;
422422
423423 // Find where the mentions end in the original string
424424 const endOfMentions = paragraph . indexOf ( matches [ 0 ] ) + matches [ 0 ] . length ;
425425
426426 // 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 ) ;
428428}
429429
430430function restoreUrls (
@@ -454,4 +454,4 @@ function splitParagraph(paragraph: string, maxLength: number): string[] {
454454 const restoredChunks = restoreUrls ( splittedChunks , placeholderMap ) ;
455455
456456 return restoredChunks ;
457- }
457+ }
You can’t perform that action at this time.
0 commit comments