aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/pages/ContentNodes.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/pages/ContentNodes.kt')
-rw-r--r--core/src/main/kotlin/pages/ContentNodes.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt
index cfcd4069..c0576006 100644
--- a/core/src/main/kotlin/pages/ContentNodes.kt
+++ b/core/src/main/kotlin/pages/ContentNodes.kt
@@ -185,6 +185,8 @@ enum class TextStyle : Style {
Bold, Italic, Strong, Strikethrough, Paragraph, Block, Monospace, Indented
}
+object CommentTable: Style
+
fun ContentNode.dfs(predicate: (ContentNode) -> Boolean): ContentNode? = if (predicate(this)) {
this
} else {
@@ -194,3 +196,5 @@ fun ContentNode.dfs(predicate: (ContentNode) -> Boolean): ContentNode? = if (pre
null
}
}
+
+fun ContentNode.hasStyle(style: Style) = this.style.contains(style)