Crates.io | markdown-it |
lib.rs | markdown-it |
version | 0.6.1 |
source | src |
created_at | 2022-07-21 22:38:53.883485 |
updated_at | 2024-07-07 17:51:58.89661 |
description | Rust port of popular markdown-it.js library. |
homepage | https://github.com/markdown-it-rust/markdown-it |
repository | https://github.com/markdown-it-rust/markdown-it |
max_upload_size | |
id | 629894 |
size | 768,962 |
Rust port of popular markdown-it.js library.
TL;DR:
@mentions
, :emoji:
, custom html classes), use this libraryYou can check a demo in your browser (it's Rust compiled into WASM).
let parser = &mut markdown_it::MarkdownIt::new();
markdown_it::plugins::cmark::add(parser);
markdown_it::plugins::extra::add(parser);
let ast = parser.parse("Hello **world**!");
let html = ast.render();
print!("{html}");
// prints "<p>Hello <strong>world</strong>!</p>"
For a guide on how to extend it, see examples
folder.
This is an attempt at making a language-agnostic parser. You can probably parse AsciiDoc, reStructuredText or any other plain text format with this without too much effort. I might eventually write these as proof-of-concept.