aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/Content.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Model/Content.kt b/src/Model/Content.kt
index 45d42a2d..6556b09e 100644
--- a/src/Model/Content.kt
+++ b/src/Model/Content.kt
@@ -11,7 +11,7 @@ public object ContentEmpty : ContentNode {
public open class ContentBlock() : ContentNode {
val children = arrayListOf<ContentNode>()
- fun append(node : ContentNode) {
+ fun append(node: ContentNode) {
children.add(node)
}
@@ -173,6 +173,12 @@ public open class Content(): ContentBlock() {
companion object {
val Empty = Content()
+
+ fun of(vararg child: ContentNode): Content {
+ val result = MutableContent()
+ child.forEach { result.append(it) }
+ return result
+ }
}
}