@@ -876,8 +876,9 @@ class _ZulipContentParser {
876
876
final debugHtmlNode = kDebugMode ? element : null ;
877
877
878
878
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' ));
881
882
int i = 0 ;
882
883
883
884
if (i >= classes.length) return null ;
@@ -895,12 +896,14 @@ class _ZulipContentParser {
895
896
}
896
897
897
898
if (i >= classes.length) return null ;
898
- if (classes[i] == 'user-mention'
899
+ if ((classes[i] == 'topic-mention' && ! hasChannelWildcardClass)
900
+ || classes[i] == 'user-mention'
899
901
|| (classes[i] == 'user-group-mention' && ! hasChannelWildcardClass)) {
900
902
// The class we already knew we'd find before we called this function.
901
903
// We ignore the distinction between these; see [UserMentionNode].
902
904
// 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.
904
907
i++ ;
905
908
}
906
909
@@ -931,9 +934,9 @@ class _ZulipContentParser {
931
934
/// Matches all className values that could be a UserMentionNode,
932
935
/// and no className values that could be any other type of node.
933
936
// 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.
935
938
static final _userMentionClassNameRegexp = RegExp (
936
- r"(^| )" r"user(?:-group)?-mention" r"( |$)" );
939
+ r"(^| )" r"(?: user(?:-group)?|topic) -mention" r"( |$)" );
937
940
938
941
static final _emojiClassNameRegexp = () {
939
942
const specificEmoji = r"emoji(?:-[0-9a-f]+)+" ;
0 commit comments