From 97b24b9b8241ce99d2185be461697e7cf2430428 Mon Sep 17 00:00:00 2001 From: AtlasAutocode Date: Fri, 10 May 2024 10:37:38 -0600 Subject: [PATCH] Fix: CheckList action --- lib/src/models/rules/insert.dart | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/src/models/rules/insert.dart b/lib/src/models/rules/insert.dart index 731be9cf..73fd044e 100644 --- a/lib/src/models/rules/insert.dart +++ b/lib/src/models/rules/insert.dart @@ -560,13 +560,15 @@ class PreserveInlineStylesRule extends InsertRule { final itr = DeltaIterator(document); var prev = itr.skip(len == 0 ? index : index + 1); - if (prev == null || - (prev.data is String && (prev.data as String).endsWith('\n'))) { - prev = itr.next(); - } - if (prev.data is! String) { - return null; + if (prev == null || prev.data is! String) return null; + + if ((prev.data as String).endsWith('\n')) { + if (prev.attributes?.containsKey(Attribute.list.key) == true) { + return null; + } + prev = itr + .next(); // at the start of a line, apply the style for the current line and not the style for the preceding line } final attributes = prev.attributes;