better link support
This commit is contained in:
parent
0c58ae562d
commit
b63c225ea5
1 changed files with 10 additions and 2 deletions
|
|
@ -112,7 +112,8 @@ class RoomChat extends HookConsumerWidget {
|
||||||
builders: Builders(
|
builders: Builders(
|
||||||
chatAnimatedListBuilder: (_, itemBuilder) =>
|
chatAnimatedListBuilder: (_, itemBuilder) =>
|
||||||
ChatAnimatedList(
|
ChatAnimatedList(
|
||||||
itemBuilder: itemBuilder,
|
itemBuilder:
|
||||||
|
itemBuilder, // TODO: Load earlier
|
||||||
onEndReached: notifier.loadOlder,
|
onEndReached: notifier.loadOlder,
|
||||||
onStartReached: () => notifier.markRead(),
|
onStartReached: () => notifier.markRead(),
|
||||||
),
|
),
|
||||||
|
|
@ -130,7 +131,14 @@ class RoomChat extends HookConsumerWidget {
|
||||||
MessageGroupStatus? groupStatus,
|
MessageGroupStatus? groupStatus,
|
||||||
}) => FlyerChatTextMessage(
|
}) => FlyerChatTextMessage(
|
||||||
customWidget: HtmlWidget(
|
customWidget: HtmlWidget(
|
||||||
message.metadata?["formatted"],
|
message.metadata?["formatted"].replaceAllMapped(
|
||||||
|
RegExp(
|
||||||
|
r'(?<!href="|">)(https?:\/\/[^\s<]+)',
|
||||||
|
caseSensitive: false,
|
||||||
|
),
|
||||||
|
(m) =>
|
||||||
|
"<a href=\"${m.group(0)!}\">${m.group(0)!}</a>",
|
||||||
|
),
|
||||||
customWidgetBuilder: (element) {
|
customWidgetBuilder: (element) {
|
||||||
if (element.localName == "mx-reply") {
|
if (element.localName == "mx-reply") {
|
||||||
return SizedBox.shrink();
|
return SizedBox.shrink();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue