Merge pull request #892 from LucasXu0/feat/link

[FR] Implement link feature in AppFlowyEditor #886
This commit is contained in:
Nathan.fooo 2022-08-27 08:46:41 +08:00 committed by GitHub
commit 63bf86df81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,7 @@ extension TextNodeExtension on TextNode {
bool allSatisfyInSelection(
String styleKey,
Selection selection,
bool Function(dynamic value) compare,
bool Function(dynamic value) test,
) {
final ops = delta.whereType<TextInsert>();
final startOffset =
@ -72,7 +72,7 @@ extension TextNodeExtension on TextNode {
if (start < endOffset && start + length > startOffset) {
if (op.attributes == null ||
!op.attributes!.containsKey(styleKey) ||
!compare(op.attributes![styleKey])) {
!test(op.attributes![styleKey])) {
return false;
}
}