fix test of urlimage parsing of pyx.li

This commit is contained in:
ericz committed 2026-09-08 21:11:58 +02:00
1 parent dbd7f2aa75
commit 86361f437f
1 file changed
+2 -5
+2 -5
View File
@@ -17,7 +17,7 @@ class MessageUrlImageHelper {
LinkedHashMap<String, Future<String?>>();
static final RegExp _pyxPattern = RegExp(
r'''https?://pyx\.li/\?i=([^\s<>'"`]+)''',
r'''https?://pyx\.li/\?i=([A-Za-z0-9_-]+)''',
caseSensitive: false,
);
@@ -57,10 +57,7 @@ class MessageUrlImageHelper {
final pyxMatch = _pyxPattern.firstMatch(trimmed);
if (pyxMatch != null) {
return _extractFromUrl(
_trimBoundary(pyxMatch.group(0)!),
RegExp(r'''<img[^>]+src=["']([^"']+)["']''', caseSensitive: false),
);
return 'https://pyx.li/i/${pyxMatch.group(1)!}.jpg';
}
final ipfsUrlMatch = _ipfsUrlPattern.firstMatch(trimmed);