| Crates.io | mark-html |
| lib.rs | mark-html |
| version | 0.2.0 |
| created_at | 2025-08-20 10:15:03.69577+00 |
| updated_at | 2025-08-20 10:27:28.502619+00 |
| description | A simple and efficient Markdown to HTML parser written in Rust. |
| homepage | |
| repository | https://github.com/Shivrajsoni/markdown-to-html-parser |
| max_upload_size | |
| id | 1803187 |
| size | 25,037 |
A simple, lightweight library for converting Markdown to HTML, written in pure, safe Rust. This project aims to provide a straightforward and easy-to-use package for your Rust applications
Currently, the following Markdown syntax is supported:
#, ##, ###, etc.)**text**)*text*)[display text](url))- list item)- codeblock item)To use mark-html in your project, you can add it to your Cargo.toml file:
[dependencies]
mark-html = "0.2.0"
Alternatively, you can use the cargo add command:
cargo add mark-html
Once the crate is added to your project, you can use the to_html function in your code:
// main.rs
extern crate mark-html;
fn main() {
let markdown = "## Hello, World!\n\nThis is a **test** of our *new* parser.\n\n- Item 1\n- Item 2";
let html = mark-html::to_html(markdown);
println!("{}", html);
}
The conversion process happens in three main stages:
**hello** becomes [BoldStart, Text("hello"), BoldEnd].Here are a few examples of the conversion in action.
Input:
# Main Title
This is a paragraph with **bold** and *italic* text. Here is a [link to GitHub](https://github.com/Shivrajsoni).
- First list item
- Second list item
Output:
<h1>Main Title</h1>
<p>This is a paragraph with <strong>bold</strong> and <em>italic</em> text. Here is a <a href="https://github.com">link to GitHub</a>.</p>
<ul>
<li>First list item</li>
<li>Second list item</li>
</ul>
This project is under active development. Contributions, issues, and feature requests are welcome!