diff options
Diffstat (limited to 'core/src/main/kotlin/Markdown')
-rw-r--r-- | core/src/main/kotlin/Markdown/MarkdownProcessor.kt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Markdown/MarkdownProcessor.kt b/core/src/main/kotlin/Markdown/MarkdownProcessor.kt index d1d40dd4..2c8f7a73 100644 --- a/core/src/main/kotlin/Markdown/MarkdownProcessor.kt +++ b/core/src/main/kotlin/Markdown/MarkdownProcessor.kt @@ -14,6 +14,8 @@ class MarkdownNode(val node: ASTNode, val parent: MarkdownNode?, val markdown: S val text: String get() = node.getTextInNode(markdown).toString() fun child(type: IElementType): MarkdownNode? = children.firstOrNull { it.type == type } + val previous get() = parent?.children?.getOrNull(parent.children.indexOf(this) - 1) + override fun toString(): String = StringBuilder().apply { presentTo(this) }.toString() } |