Indent attribute is consider block but may have null value

pull/162/head
Xin Yao 4 years ago
parent b6763fe2fc
commit bc5eb86a8f
  1. 2
      lib/models/documents/nodes/line.dart
  2. 9
      lib/models/documents/style.dart

@ -197,7 +197,7 @@ class Line extends Container<Leaf?> {
} }
applyStyle(newStyle); applyStyle(newStyle);
final blockStyle = newStyle.getBlockExceptHeader(); final blockStyle = newStyle.getNotNullValueBlockExceptHeader();
if (blockStyle == null) { if (blockStyle == null) {
return; return;
} // No block-level changes } // No block-level changes

@ -56,6 +56,15 @@ class Style {
return null; return null;
} }
Attribute? getNotNullValueBlockExceptHeader() {
for (final val in values) {
if (val.isBlockExceptHeader && val.value != null) {
return val;
}
}
return null;
}
Style merge(Attribute attribute) { Style merge(Attribute attribute) {
final merged = Map<String, Attribute>.from(_attributes); final merged = Map<String, Attribute>.from(_attributes);
if (attribute.value == null) { if (attribute.value == null) {

Loading…
Cancel
Save