Skip to content

Commit

Permalink
fix: updates default parser to remove "@" prefix from user mention ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Crazelu committed Dec 27, 2023
1 parent 4a9b039 commit 50e09dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/tagger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ class _FlutterTaggerState extends State<FlutterTagger> {
}

final resultString = result.join(" ");

return resultString;
}

Expand Down Expand Up @@ -909,7 +910,8 @@ class FlutterTaggerController extends TextEditingController {
return [split[1].trim(), split[2].trim()];
}
//default user mention group match (name and id)
return [split.first.trim(), split[split.length - 2].trim()];
final id = split.first.trim().replaceFirst("@", "");
return [id, split[split.length - 2].trim()];
};

final matches = pattern.allMatches(text);
Expand Down

0 comments on commit 50e09dc

Please sign in to comment.