Update Line _format method

pull/180/head
Xin Yao 4 years ago
parent 451dffc4cd
commit ca9a13b150
  1. 7
      lib/models/documents/nodes/line.dart

@ -1,5 +1,7 @@
import 'dart:math' as math; import 'dart:math' as math;
import 'package:collection/collection.dart';
import '../../quill_delta.dart'; import '../../quill_delta.dart';
import '../attribute.dart'; import '../attribute.dart';
import '../style.dart'; import '../style.dart';
@ -203,10 +205,11 @@ class Line extends Container<Leaf?> {
} // No block-level changes } // No block-level changes
if (parent is Block) { if (parent is Block) {
final parentStyle = (parent as Block).style.getBlockExceptHeader(); final parentStyle = (parent as Block).style.getBlocksExceptHeader();
if (blockStyle.value == null) { if (blockStyle.value == null) {
_unwrap(); _unwrap();
} else if (blockStyle != parentStyle) { } else if (!const MapEquality()
.equals(newStyle.getBlocksExceptHeader(), parentStyle)) {
_unwrap(); _unwrap();
_applyBlockStyles(newStyle); _applyBlockStyles(newStyle);
} // else the same style, no-op. } // else the same style, no-op.

Loading…
Cancel
Save