@@ -876,8 +876,9 @@ class _ZulipContentParser {
876876    final  debugHtmlNode =  kDebugMode ?  element :  null ;
877877
878878    final  classes =  element.className.split (' ' )..sort ();
879-     assert (classes.contains ('user-mention' )
880-         ||  classes.contains ('user-group-mention' ));
879+     assert (classes.contains ('topic-mention' )
880+       ||  classes.contains ('user-mention' )
881+       ||  classes.contains ('user-group-mention' ));
881882    int  i =  0 ;
882883
883884    if  (i >=  classes.length) return  null ;
@@ -895,12 +896,14 @@ class _ZulipContentParser {
895896    }
896897
897898    if  (i >=  classes.length) return  null ;
898-     if  (classes[i] ==  'user-mention' 
899+     if  ((classes[i] ==  'topic-mention'  &&  ! hasChannelWildcardClass)
900+         ||  classes[i] ==  'user-mention' 
899901        ||  (classes[i] ==  'user-group-mention'  &&  ! hasChannelWildcardClass)) {
900902      // The class we already knew we'd find before we called this function. 
901903      // We ignore the distinction between these; see [UserMentionNode]. 
902904      // Also, we don't expect "user-group-mention" and "channel-wildcard-mention" 
903-       // to be in the list at the same time. 
905+       // to be in the list at the same time and neither we expect "topic-mention" 
906+       // and "channel-wildcard-mention" to be in the list at the same time. 
904907      i++ ;
905908    }
906909
@@ -931,9 +934,9 @@ class _ZulipContentParser {
931934  /// Matches all className values that could be a UserMentionNode, 
932935  /// and no className values that could be any other type of node. 
933936// Specifically, checks for `user-mention` or `user-group-mention` 
934-   // as a member of the list. 
937+   // or `topic-mention`  as a member of the list. 
935938  static  final  _userMentionClassNameRegexp =  RegExp (
936-     r"(^| )"  r"user(?:-group)?-mention"  r"( |$)" );
939+     r"(^| )"  r"(?: user(?:-group)?|topic) -mention"  r"( |$)" );
937940
938941  static  final  _emojiClassNameRegexp =  () {
939942    const  specificEmoji =  r"emoji(?:-[0-9a-f]+)+" ;
0 commit comments