Markdown Obsidian parser
An extension of the markdown parser (https://github.com/JetBrains/markdown) that supports Obsidian flavoured markdown (https://help.obsidian.md/obsidian-flavored-markdown).

Installation

settings.gradle.kts:
pluginManagement {
repositories {
mavenCentral()
}
}
gradle.kts:
dependencies {
implementation("io.github.pchochura:markdown-obsidian-parser:{LATEST_VERSION}")
}
Usage
The library extends the markdown parser created by Intellij (https://github.com/JetBrains/markdown) with a set of Obsidian Flavoured Markdown nodes:
val parser = MarkdownParser(ObsidianFlavourDescriptor())
val input = """
# Extended Markdown Example with Footnotes
## Text Formatting
This is **bold**, *italic*, ~~strikethrough~~, ==highlight== and %%comment%%
#tags
## Lists
- Item 1
- Item 2 ^inline-block
- Subitem
1. Item 1
2. Item 2
1. Subitem
## Links
[OpenAI](https://www.openai.com)
[[Internal link|label]]
![[Title|label]]
## Block Quote
> This is a block quote. **Inline bold**
> It can span multiple lines.
---
^block
## Inline Code
Here is some inline code`print("Hello, Markdown!")`
## Code Block
```python
def greet(name):
print(f"Hello, {name}!")
greet("Paweł")
```
## Footnotes
Footnotes are a way to add references or additional info[^2].
There are also inline footnotes ^[some description]
[^1]: Highlighting with == is not standard Markdown and may not work in all renderers.
[^2]: This is an example of a footnote. It appears at the bottom and can contain links, references, etc.
## Callouts
> [!info] title
> Contents
"""
val result = parser.buildMarkdownTreeFromString(input)