Fix: CheckList action

pull/1857/head
AtlasAutocode 12 months ago
parent 7b598ad9c6
commit 97b24b9b82
  1. 14
      lib/src/models/rules/insert.dart

@ -560,13 +560,15 @@ class PreserveInlineStylesRule extends InsertRule {
final itr = DeltaIterator(document); final itr = DeltaIterator(document);
var prev = itr.skip(len == 0 ? index : index + 1); 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) { if (prev == null || prev.data is! String) return null;
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; final attributes = prev.attributes;

Loading…
Cancel
Save