AppFlowy/frontend/appflowy_flutter/lib/util/default_extensions.dart
Morn 4997ac99cf
feat: revamp link preivew (#7692)
* feat: revamp link preivew

* feat: add convert to menu for link hover menu

* feat: add mention link

* feat: support convert preview to mention

* feat: add embed link preview

* fix: some test erros

* fix: test errors

* fix: some UI issues

* chore: add test for url

* chore: add test for mention

* chore: add test for bookmark

* chore: add test for embed

* chore: remove unuse import

* fix: some UI issues

* fix: remove text span overlay on mobile

* fix: code lint error

---------

Co-authored-by: Lucas <lucas.xu@appflowy.io>
2025-04-10 14:45:13 +08:00

23 lines
644 B
Dart

/// List of default file extensions used for images.
///
/// This is used to make sure that only images that are allowed are picked/uploaded. The extensions
/// should be supported by Flutter, to avoid causing issues.
///
/// See [Image-class documentation](https://api.flutter.dev/flutter/widgets/Image-class.html)
///
const List<String> defaultImageExtensions = [
'jpg',
'png',
'jpeg',
'gif',
'webp',
'bmp',
];
bool isNotImageUrl(String url) {
final nonImageSuffixRegex = RegExp(
r'(\.(io|html|php|json|txt|js|css|xml|md|log)(\?.*)?(#.*)?$)|/$',
caseSensitive: false,
);
return nonImageSuffixRegex.hasMatch(url);
}