From 1fc32244dcd3d7b35a2340612c10595b8761747e Mon Sep 17 00:00:00 2001 From: EgorK0rshun Date: Fri, 25 Aug 2023 14:48:49 +0300 Subject: [PATCH] Fix bug with keepStyleOnNewLine for link --- CHANGELOG.md | 3 +++ lib/src/widgets/controller.dart | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c60f2317..16fcb887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# [7.4.2] +- Fix bug with keepStyleOnNewLine for link. + # [7.4.1] - Fix toolbar dividers condition. diff --git a/lib/src/widgets/controller.dart b/lib/src/widgets/controller.dart index 16e919e8..dd7aff07 100644 --- a/lib/src/widgets/controller.dart +++ b/lib/src/widgets/controller.dart @@ -400,7 +400,9 @@ class QuillController extends ChangeNotifier { extentOffset: math.min(selection.extentOffset, end)); if (_keepStyleOnNewLine) { final style = getSelectionStyle(); - final notInlineStyle = style.attributes.values.where((s) => !s.isInline); + final notInlineStyle = style.attributes.values.where( + (s) => !s.isInline || s.key == Attribute.link.key, + ); toggledStyle = style.removeAll(notInlineStyle.toSet()); } else { toggledStyle = Style();