
Extends standard Markdown parsing to support Obsidian-flavored syntax, including internal links, embeds, block refs, footnotes, highlights, callouts, tasks, comments, and AST generation.
An extension of the markdown parser (https://github.com/JetBrains/markdown) that supports Obsidian flavoured markdown (https://help.obsidian.md/obsidian-flavored-markdown).
settings.gradle.kts:
pluginManagement {
repositories {
mavenCentral()
}
}gradle.kts:
dependencies {
implementation("io.github.pchochura:markdown-obsidian-parser:{LATEST_VERSION}")
}The library extends the markdown parser created by Intellij (https://github.com/JetBrains/markdown) with a set of Obsidian Flavoured Markdown nodes:
| Node | Description |
|---|---|
| [[link]] | Internal link |
| ![[link]] | Embed file |
| ![[link#^id]] | Block reference |
| ^id | Defining a block |
| [^id] | Footnote |
| ^[footnote] | Inline footnote |
| %%Text%% | Comment |
| Strikethrough | |
| ==Text== | Highlight |
print("Hello") |
Code block |
| - [ ] | Incomplete task |
| - [x] | Complete task |
| > [!note] title | Callout |
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)An extension of the markdown parser (https://github.com/JetBrains/markdown) that supports Obsidian flavoured markdown (https://help.obsidian.md/obsidian-flavored-markdown).
settings.gradle.kts:
pluginManagement {
repositories {
mavenCentral()
}
}gradle.kts:
dependencies {
implementation("io.github.pchochura:markdown-obsidian-parser:{LATEST_VERSION}")
}The library extends the markdown parser created by Intellij (https://github.com/JetBrains/markdown) with a set of Obsidian Flavoured Markdown nodes:
| Node | Description |
|---|---|
| [[link]] | Internal link |
| ![[link]] | Embed file |
| ![[link#^id]] | Block reference |
| ^id | Defining a block |
| [^id] | Footnote |
| ^[footnote] | Inline footnote |
| %%Text%% | Comment |
| Strikethrough | |
| ==Text== | Highlight |
print("Hello") |
Code block |
| - [ ] | Incomplete task |
| - [x] | Complete task |
| > [!note] title | Callout |
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)