Override Leaf toString method

pull/602/head
X Code 3 years ago
parent 100de11a89
commit 90b6000da7
  1. 1
      lib/src/models/documents/attribute.dart
  2. 7
      lib/src/models/documents/nodes/leaf.dart

@ -12,6 +12,7 @@ enum AttributeScope {
class Attribute<T> {
Attribute(this.key, this.scope, this.value);
/// Unique key of this attribute.
final String key;
final AttributeScope scope;
final T value;

@ -101,6 +101,13 @@ abstract class Leaf extends Node {
}
}
@override
String toString() {
final keys = style.keys.toList(growable: false)..sort();
final styleKeys = keys.join();
return '$value$styleKeys';
}
/// Adjust this text node by merging it with adjacent nodes if they share
/// the same style.
@override

Loading…
Cancel
Save