Add support for markdown footnotes (ref #76)

This commit is contained in:
Felix Ableitner 2024-10-23 11:32:26 +02:00
parent e7d480098f
commit 71af03c0f6
3 changed files with 12 additions and 0 deletions

10
Cargo.lock generated
View File

@ -1746,6 +1746,7 @@ dependencies = [
"log", "log",
"markdown-it", "markdown-it",
"markdown-it-block-spoiler", "markdown-it-block-spoiler",
"markdown-it-footnote",
"markdown-it-heading-anchors", "markdown-it-heading-anchors",
"once_cell", "once_cell",
"pretty_assertions", "pretty_assertions",
@ -2315,6 +2316,15 @@ dependencies = [
"markdown-it", "markdown-it",
] ]
[[package]]
name = "markdown-it-footnote"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6679ab967fbc45b290b25fb477af7556bf6825feec208a970585e6bb9aae3be"
dependencies = [
"markdown-it",
]
[[package]] [[package]]
name = "markdown-it-heading-anchors" name = "markdown-it-heading-anchors"
version = "0.3.0" version = "0.3.0"

View File

@ -83,6 +83,7 @@ katex = { version = "0.4", default-features = false }
include_dir = "0.7.4" include_dir = "0.7.4"
markdown-it-block-spoiler = "1.0.0" markdown-it-block-spoiler = "1.0.0"
markdown-it-heading-anchors = "0.3.0" markdown-it-heading-anchors = "0.3.0"
markdown-it-footnote = "0.2.0"
[dev-dependencies] [dev-dependencies]
pretty_assertions = "1.4.1" pretty_assertions = "1.4.1"

View File

@ -30,6 +30,7 @@ fn markdown_parser() -> MarkdownIt {
let mut parser = MarkdownIt::new(); let mut parser = MarkdownIt::new();
markdown_it::plugins::cmark::add(&mut parser); markdown_it::plugins::cmark::add(&mut parser);
markdown_it_heading_anchors::add(&mut parser); markdown_it_heading_anchors::add(&mut parser);
markdown_it_footnote::add(&mut parser);
markdown_it::plugins::extra::strikethrough::add(&mut parser); markdown_it::plugins::extra::strikethrough::add(&mut parser);
markdown_it::plugins::extra::tables::add(&mut parser); markdown_it::plugins::extra::tables::add(&mut parser);
markdown_it::plugins::extra::typographer::add(&mut parser); markdown_it::plugins::extra::typographer::add(&mut parser);