Add mentions, kind of

This commit is contained in:
Henry Hiles 2025-12-04 19:13:31 -05:00
commit 1cd3dad8ab
No known key found for this signature in database
2 changed files with 23 additions and 4 deletions

View file

@ -36,6 +36,26 @@ class Html extends ConsumerWidget {
"blockquote" => Quoted(Html(element.innerHtml, client: client)),
"a" =>
Uri.tryParse(element.attributes["href"] ?? "")?.host == "matrix.to"
? InlineCustomWidget(
child: ActionChip(
label: Text(
element.text,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onPrimary,
),
),
backgroundColor: Theme.of(context).colorScheme.primary,
onPressed: () {
// TODO: Open room or join room dialog, or user popover
showAboutDialog(context: context);
},
),
)
: null,
"img" =>
element.attributes["src"] == null
? null
@ -90,7 +110,6 @@ class Html extends ConsumerWidget {
"h5" ||
"h6" ||
"p" ||
"a" ||
"ul" ||
"ol" ||
"sup" ||