diff --git a/lib/src/models/documents/attribute.dart b/lib/src/models/documents/attribute.dart index ecf05e26..dc782098 100644 --- a/lib/src/models/documents/attribute.dart +++ b/lib/src/models/documents/attribute.dart @@ -12,6 +12,7 @@ enum AttributeScope { class Attribute { Attribute(this.key, this.scope, this.value); + /// Unique key of this attribute. final String key; final AttributeScope scope; final T value; diff --git a/lib/src/models/documents/nodes/leaf.dart b/lib/src/models/documents/nodes/leaf.dart index f2ccf75c..1fc29b5e 100644 --- a/lib/src/models/documents/nodes/leaf.dart +++ b/lib/src/models/documents/nodes/leaf.dart @@ -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