🐛 Fix regex in markdown

This commit is contained in:
2026-01-06 01:08:09 +08:00
parent e1eb0f705e
commit 67805b413e

View File

@@ -266,7 +266,13 @@ class _MentionInlineSyntax extends markdown.InlineSyntax {
@override @override
bool onMatch(markdown.InlineParser parser, Match match) { bool onMatch(markdown.InlineParser parser, Match match) {
final alias = match[0]!; final prefix = match[1] ?? '';
final alias = match[2]!;
if (prefix.isNotEmpty) {
parser.addNode(markdown.Text(prefix));
}
final parts = alias.substring(1).split('/'); final parts = alias.substring(1).split('/');
final typeShortcut = parts.length == 1 ? 'u' : parts.first; final typeShortcut = parts.length == 1 ? 'u' : parts.first;
final type = switch (typeShortcut) { final type = switch (typeShortcut) {